Python implementation of treaps
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.