• This is a Python 2 and Python 3 implementation (tested on CPython, Pypy and Jython) of Red-Black Trees.
  • It passes pylint, so the code probably isn't too awful.
  • Most of this code was written by Duncan Smith; I (Dan Stromberg) just put some finishing touches on it.
  • It supports set and dictionary use.
  • Also included is a basic Binary Tree, from which the Red Black Trees inherit.
  • Download here
  • Example use:
  • Looking to store duplicates in a red-black tree? See dupdict_mod.
  • See also this list of datastructures I've worked on.


    Hits: 12697
    Timestamp: 2024-11-10 06:35:11 PST

    Back to Dan's tech tidbits

    You can e-mail the author with questions or comments: