treaps in python

D

Dan Stromberg

I've just released my treap.py module:

http://stromberg.dnsalias.org/~dstromberg/treap/

It's code that implements a datastructure that is a hybrid of a binary
tree and a binary heap, having some of the advantages of each. The URL
has a table comparing the asymptotic performance of treaps against some
other common python datastructures.

This particular implementation is pretty dicitionary-like, but you can
also get the smallest value or the largest value in O(log2(n)) time, or
get a forward or reverse ordered list of values in O(n) time. The price
of course is that adding and deleting things is O(log2(n)) time.

It's currently GPLv3-licensed, but I'd like to dual license it in such a
way that it could eventually be included in the standard library. How
would I go about this?

Also, what's the best way to package something like this for consumption
by python-folk? There seem to be so many ways of packaging things
anymore. Are dist utils, a .deb and a .rpm the way to go? Right now,
it's just using make to stuff things in /usr/local.

There are two versions: One that is pure python, and one that is part
python and part cython. They're automatically generated from a common
m4 template.

There are rather plentiful unit tests included in the tar archive.

I hope someone besides me finds it useful.
 
C

Carl Banks

It's currently GPLv3-licensed, but I'd like to dual license it in such a
way that it could eventually be included in the standard library.  How
would I go about this?

I'm not going to try to talk you out of dual licensing it as something
other than GPL, but you should note that we just had a thread
discussing a proposal to include a data structure I consider more
generally useful (graph), and that ended up pretty much dead.


Carl Banks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top