Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Balanced binary tree implementation

0 views
Skip to first unread message

Lucas P Melo

unread,
Jul 21, 2009, 5:08:07 PM7/21/09
to pytho...@python.org
Hello,

I would like to use a balanced binary tree implementation (preferably
within some API).
Any hints about where I could find it?

I am looking for something that implements insertion, deletion, search
and a special search that returns the lesser element bigger than a given
key [1].

A nice possibility would be an extensible API that allows me to inherit
its classes and to add operations myself.

Thanks in advance.

[1] Ex: 1 2 3 4 5 6 are elements of the bbt. If I use this operation
given 4 as the parameter, the value returned would be 5.

Piet van Oostrum

unread,
Jul 21, 2009, 6:01:35 PM7/21/09
to
>>>>> Lucas P Melo <lukep...@gmail.com> (LPM) wrote:

>LPM> Hello,
>LPM> I would like to use a balanced binary tree implementation (preferably
>LPM> within some API).
>LPM> Any hints about where I could find it?

>LPM> I am looking for something that implements insertion, deletion, search and
>LPM> a special search that returns the lesser element bigger than a given key
>LPM> [1].

>LPM> A nice possibility would be an extensible API that allows me to inherit its
>LPM> classes and to add operations myself.

>LPM> Thanks in advance.

>LPM> [1] Ex: 1 2 3 4 5 6 are elements of the bbt. If I use this operation given
>LPM> 4 as the parameter, the value returned would be 5.

http://newcenturycomputers.net/projects/rbtree.html (warning: see end of
page!)

http://pypi.python.org/pypi/rbtree/

http://pyavl.sourceforge.net/

http://code.activestate.com/recipes/576817/
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: pi...@vanoostrum.org

M.-A. Lemburg

unread,
Jul 23, 2009, 12:56:24 PM7/23/09
to Lucas P Melo, pytho...@python.org
Lucas P Melo wrote:
> Hello,

>
> I would like to use a balanced binary tree implementation (preferably
> within some API).

> Any hints about where I could find it?
>
> I am looking for something that implements insertion, deletion, search
> and a special search that returns the lesser element bigger than a given
> key [1].

>
> A nice possibility would be an extensible API that allows me to inherit
> its classes and to add operations myself.
>
> Thanks in advance.

>
> [1] Ex: 1 2 3 4 5 6 are elements of the bbt. If I use this operation
> given 4 as the parameter, the value returned would be 5.

You might want to have a look at the btree implementation we
have in mxBeeBase:

http://www.egenix.com/products/python/mxBase/mxBeeBase/

It's written in C and optimized for on-disk operations.

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Jul 23 2009)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/

0 new messages