Skip to main content

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 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