Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Python implementation of treaps

Project description

A dictionary-like treap implementation, a treap being a hybrid of a binary tree and a binary heap. Aside from acting like a dictionary, it has operations for inorder and reverse order traversal, and finding the max or min item in the collection. Most operations on a treap or O(nlog2(n)), but some are O(n) - EG returning a sorted list.

Most likely application is keeping the best p elements from a collection of q elements, p < q.

Comes with a plethora of unit tests.

Project details

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page