binary tree in python?

Alex Martelli aleaxit at yahoo.com
Mon Nov 6 03:42:29 EST 2000


<ranga_r at my-deja.com> wrote in message news:8u5ksq$kak$1 at nnrp1.deja.com...
> hello
>
> i would like to know if there is any reference/documentation/code
> available on implementing a binary tree in python.

At http://www.python.org/ftp/python/contrib-09-Dec-1999/DataStructures/
you'll find a few interesting datastructures for Python; the AVL tree
is a (balanced) binary search tree with extra features, and often quite
handy (not quite as advanced as a red-black tree, but I don't know of
any "generic R-B tree" modules for Python).

However, this is written FOR Python, not IN Python -- it's a fast C
coded module.  Great for production work, but, if what you're looking
for is something of a didactical nature, it will not help.  Unfortunately,
I don't know about any "classical algorithms and data structures in
Python" site/page -- maybe it's time to start putting one together...


Alex






More information about the Python-list mailing list