Randomness in built-in .sort

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jan 4 22:08:16 PST 2009


dsimcha wrote:
> On another note, it would be nice if std.algorithm implemented a stable O(N log N)
> sort, like a merge sort.  Right now, IIRC it uses an interesting stable swapping
> algorithm on top of a quick sort for O(N log^2 N) performance.  This is good when
> space is tight, but I think in most cases a merge sort is better as a stable sort.

I agree. I didn't have the time to implement a very good stable sort, 
but I also think the extra slowness is not critical. If anyone comes 
with a better implementation, I'd be glad to integrate it.

Andrei



More information about the Digitalmars-d mailing list