[fpc-pascal] TimSort

Vincent Snijders vincent.snijders at gmail.com
Tue May 24 19:39:21 CEST 2011


2011/5/24 José Mejuto <joshyfun at gmail.com>:
> Hello FPC-Pascal,
>
> Tuesday, May 24, 2011, 1:06:43 PM, you wrote:
>
>  >> Why is TimSort specially interesting to you ?
> MG>  I need a fast stable sort, so multiple sorts work as expected (contrary to
> MG> QuickSort).
> MG>  TimSort is a candidate.
>
> That's exactly the answer I was looking for, the stability need ;)
> I'll try to write an implementation to expand my sorters collection :)
> but the algo seems quite "confuse" and plenty of "tricks".

I suggest you start from the explanation on
http://svn.python.org/projects/python/trunk/Objects/listsort.txt

The same text be found on other places too.

I more or less explains the algorithm, which you can implement without
copyright restrictions, don't you think?

Vincent



More information about the fpc-pascal mailing list