view package:heap

O(1) for the head, O(log n) for the tail. Find the item with minimal associated priority and remove it from the Heap (i. e. find head and tail of the heap) if it is not empty. Otherwise, Nothing is returned.
O(1). Find the item with minimal associated priority on the Heap (i. e. its head) if it is not empty. Otherwise, Nothing is returned.
O(log n). Remove the item with minimal associated priority and from the Heap (i. e. its tail) if it is not empty. Otherwise, Nothing is returned.