Parallel Merge Sort

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 4 15:46:22 PST 2015


Ali Çehreli:

> I think there is bug in the algorithm:
>
>     auto a = [90, 50, 33, 72, 35];
>     a.mergeSort;
>     assert(a == [33, 50, 72, 90, 35]);    // Incorrect ordering 
> :(

I translated that D code from C code of Wikipedia in few minutes, 
the probability of mistakes is high. Better to use some more 
reliable code then...

Bye,
bearophile


More information about the Digitalmars-d mailing list