Timsort vs some others

deadalnix deadalnix at gmail.com
Tue Dec 18 21:00:59 PST 2012


On Tuesday, 18 December 2012 at 15:41:28 UTC, Joseph Rushton 
Wakeling wrote:
> On 12/18/2012 04:30 PM, bearophile wrote:
>> Why?
>
> Because if you have to allocate O(n) memory for another 
> algorithm, that might either give you a memory hit that you 
> can't take (less likely these days, to be fair), or simply take 
> a large amount of time to allocate that degrades the 
> performance.
>
> Happy to learn if my guess is wrong, though.

Unless you have the data somehow presorted, or you get them one 
by one, other sort are faster.


More information about the Digitalmars-d mailing list