Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44618

Re: Red Black Tree implementation?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <christian@python.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=python.org; s=200901; t=1367491608; bh=FieBwzxzIWfi8SnJCEpd82/xAuh8H2Gc6vvgxbO24pE=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=R60UTDY8MLZFPJDoWYvX7gFVbi/B6UuxJiGO9+7zm10n2Rn0OP27HPCZ+QPNI4pXk H1MGOYXMc2wpng0/Zh/6tktki6FV6N+8MRSP/ThMPoIxlhih71moBXr313eoAkrayA uVET9YkqPT+PA47Egn/iYAE17S76ssVEnin3Dwzc=
Date Thu, 02 May 2013 12:46:47 +0200
From Christian Heimes <christian@python.org>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To Dan Stromberg <drsalists@gmail.com>
Subject Re: Red Black Tree implementation?
References <CAGGBd_rsM7LVd_V=Xb64vqeXmYCx2uxAnQfJo3MsHXJOphzJBQ@mail.gmail.com>
In-Reply-To <CAGGBd_rsM7LVd_V=Xb64vqeXmYCx2uxAnQfJo3MsHXJOphzJBQ@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1229.1367491610.3114.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367491610 news.xs4all.nl 15990 [2001:888:2000:d::a6]:40832
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44618

Show key headers only | View raw


Am 02.05.2013 01:11, schrieb Dan Stromberg:
> 
> What's the best Red Black Tree implementation for Python with an
> opensource license?
> 
> I started out looking at
> http://newcenturycomputers.net/projects/rbtree.html
> <http://newcenturycomputers.net/projects/rbtree..html> because it was
> pretty high in Google and had the operators I wanted, but it gets very
> slow at about half a million elements.  I've been discussing this with a
> C programmer who believes that Red Black Trees should perform very
> similarly to an AVL tree, but that's not at all what I'm getting with
> the newcenturycomputers implementation.

No wonder it's getting slow and doesn't stand a change against Python's
dict implementation. The rbtree implementation from
newcenturycomputers.net is written entirely in Python. It's good code
for academic research in order to study the properties of a rbtree.

If you need something production ready then you have to use an
implemetation with an optimized backend like a C code, PyPy or Cython.

Christian

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Red Black Tree implementation? Christian Heimes <christian@python.org> - 2013-05-02 12:46 +0200

csiph-web