[fpc-pascal] "Generics" Red Black Tree for fpc

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Apr 3 16:51:02 CEST 2009


On Fri, 3 Apr 2009 13:08:42 +0200
Helmut Hartl <helmut.hartl at firmos.at> wrote:

> Hi all,
> 
> due to interest i post here our generic version of a red black tree
> implementation. A R/B tree is a quite fast directory datastructure
> which allows o(log n) access times.
> 
> Warning: The code compiles only under 2.2.4RC1+, below that the
> compilation fails(crash).
> 
> Further info on
> http://fpcfun.firmos.at/bin/view/Freepascal/FirmOSOpenSource
> 
> A short description with usage guidelines and a testprogram
> demonstrating adding and searching 10 Million key / value pairs is
> provided there too. 
> 
> The code was tested under FreeBSD (dev platform), linux and windows
> and has no dependancys.
> 
> have fun,

I surely have.

How much work do you think is it to extend it to accept duplicate keys?


Mattias



More information about the fpc-pascal mailing list