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(log2(n)) 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.

A module is provided for treaps that enforce uniqueness.

A pure python version is included, as is a Cython-enhanced version for performance.

Release 1.37 is pylint’d and is known to run on at least CPython 2.x, CPython 3.x and Pypy, Pypy3 (beta) and Jython.

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.37.tar.gz (83.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for treap-1.37.tar.gz
Algorithm Hash digest
SHA256 8fb5a23b306d9cfe9052707aec18d11acf0fa8c124f14ddd709204cbf1ed117a
MD5 8fb40ddf4a4c0429c7abfb5256afb0a3
BLAKE2b-256 4ee63c0d23d7cecfb4304780ce076c27e13568b21e8195e8f1cbe0d423562aee

See more details on using hashes here.

Supported by

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