Binary search tree

Jake McKnight jake.mcknight at gmail.com
Fri Nov 9 16:34:23 EST 2007


What if someone wants to implement, say, Huffman compression?  That requires
a binary tree and the ability to traverse the tree.  I've been looking for
some sort of binary tree library as well, and I haven't had any luck.

On 11/9/07, Larry Bates <larry.bates at websafe.com> wrote:
>
> maxim.novak at gmail.com wrote:
> > Hi,
> >
> > I have to get list of URLs one by one and to find the URLs that I have
> > more than one time(can't be more than twice).
> >
> > I thought to put them into binary search tree, this way they'll be
> > sorted and I'll be able to check if the URL already exist.
> >
> > Couldn't find any python library that implements trees.
> > Is there some library of this kind in python? Or can I find it
> > somewhere else?
> >
> Put them into a set.  You can check for existence (very fast) and at the
> end it
> is easy to sort.
>
> -Larry
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Jake McKnight
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071109/9a32047d/attachment.html>


More information about the Python-list mailing list