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.22 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.23.tar.gz (60.9 kB view details)

Uploaded Source

File details

Details for the file treap-1.23.tar.gz.

File metadata

  • Download URL: treap-1.23.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for treap-1.23.tar.gz
Algorithm Hash digest
SHA256 391b317b3381b8997288ba0f4510cb3ce372f9e3576d9a2036b9ce7c7a066f0e
MD5 4a4dc6075e5a7b48cbfe2c1578b31ea9
BLAKE2b-256 a80fe335d33aace3e3eb863b3925f6f7282363916c9ff478d6434b089f50b47d

See more details on using hashes here.

Supported by

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