On 12/05/2012 13:17, Jean-Daniel wrote: > Hello, > Do you know the best way to do this in Python with the stdlib? Sorry, not part of the stdlib but search for red black tree here http://pypi.python.org/pypi. While you're there also take a look at the blist package. -- Cheers. Mark Lawrence.