Skip to main content

Python implementation of treaps

Project description

A set of python modules implementing treaps is provided.

Treaps perform most operations in O(log2n) time, and are innately sorted. They’re very nice for keeping a collection of values that needs to always be sorted, or for optimization problems in which you need to find the p best values out of q, when p is much smaller than q.

Modules are provided for both treaps that enforce uniqueness, and treaps that allow duplicates.

Pure python versions are included, as are Cython-enhanced versions for performance.

Release 1.20 is pylint’d and is known to run on at least CPython 2, CPython 3 and Pypy 1.4.1.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treap-1.20.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page