The problem with the D GC [OT: Quicksort]

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Tue Jan 9 15:41:28 PST 2007


Kevin Bealer wrote:
> I would think you are find if you pick your pivot at random(), and seed the random
> number generator at the top of your program with microseconds-since-1970 or
> whatever the convenient chaotic local number is.

IIRC randomizing the input is a rather general solution to this kind of 
problem (not just with Quicksort).

> Or you could probably just use D's [].sort method -- I think Walter said it uses
> quick-sort but checks for poor performance and switches to a heap sort automatically.

That would be a variant of introsort. I believe I mentioned it.



More information about the Digitalmars-d mailing list