• 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: 11631
    Timestamp: 2024-03-29 03:18:06 PDT

    Back to Dan's tech tidbits

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