Quadratic time to sort in a simple case?

Xinok xinok at live.com
Wed Apr 24 20:05:21 PDT 2013


On Friday, 19 April 2013 at 22:37:45 UTC, Ivan Kazmenko wrote:
> So, why isn't TimSort the default?

I would actually argue for this, not for safety (introsort is an 
adequate solution) but for different reasons. Timsort is stable 
and it's faster on data with low entropy, being nearly 
instantaneous on already sorted lists. I would guess it's the 
better choice for most cases. Then for those cases where stable 
sorting isn't necessary and unstable sorting would be faster, the 
user could choose the second option.


More information about the Digitalmars-d-learn mailing list