Sample implementation of a priority queue using a binary heap.
Rules followed:
- The queue must have an insert method which takes a number.
- If the number is not already present in the queue, it is added to the queue with a priority equal to the number.
- If the number is present, it's priority is increased by one.
- The queue must have a remove method which does not take any arguments, and removes and returns the number with the highest priority.
- The insert and remove functions should run in O(lg n)
- Assume that all inputs are safe.
- Don't pull in any external libraries.
TODO: Add documentation and lintify it.
- Created by Aaron C. Schafer on 8/30/2016.