[fpc-pascal] TimSort

José Mejuto joshyfun at gmail.com
Tue May 24 19:53:12 CEST 2011

Hello FPC-Pascal,

Tuesday, May 24, 2011, 6:31:56 PM, you wrote:

MG>  It uses a lot of tricks, but it seems to me that Tim explained all the
MG> important things.
MG>  It would be nice, if thetimsort unit has the same license as the FCL (modified
MG> LGPL-2).
MG>  Maybe you can ask him for permission.
MG>  The c implementation uses some ugly macros, but the rest should be easily
MG> translated to pascal.

I'm now implementing from scratch, maybe it will not be the "fastest"
implementation but I hope that at least works :) After partial
implemenation it looks like a combination of insertion sort for small
runs and mergesort to combine the already sorted runs.

Anyway it looks to need O(n) auxiliary storage, where O could be a

Implementing from paper needs permission to licensing ? Is the algo
copyrighted/patented ?

Best regards,

More information about the fpc-pascal mailing list