A simple implementation of the Min Heap and Max Heap
Project description
Hipster
Hipster provides a simple implementation of the MinHeap and MaxHeap. The object being added to the respective heaps need to implement the comparator logic. The APIs are identical for MinHeap and MaxHeap
Usage
pip install hipster
from hipster.heap import MaxHeap
max_heap = MaxHeap()
max_heap.push(item)
r = max_heap.peek()
# Returns the item without popping it off the heap
r = max_heap.pop()
# Returns the item and pops it off the heap
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hipster-1.0.1.tar.gz
(1.6 kB
view hashes)