Worst-case performance of quickSort / getPivot

Vladimir Panteleev vladimir at thecybershadow.net
Fri Nov 15 15:20:55 PST 2013


On Friday, 15 November 2013 at 22:56:58 UTC, Craig Dillabaugh 
wrote:
> What are the arguments against using a randomized algorithm?

- Inconsistent execution time - someone trying to benchmark 
Phobos sort functions might get really confused;
- QuickSort is an unstable sort. If there is more to the data 
than the items being compared, the data will end up in a 
different order on different program runs.
- std.algorithm's sort allows specifying arbitrary code as a 
predicate. If that code has side effects, the program will behave 
differently on different runs.


More information about the Digitalmars-d mailing list