Heap
A heap is a special type of tree with the property that every node is larger than its children. If every node is smaller than its children the heap is referred to as a min-heap. The most common type of heap is a binary heap, but fibonacci heaps give better complexity.
Due to this property heaps are very useful for priority queues, the node with the highest priority will always be the root node.
| Operation | Complexity | Description |
|---|---|---|
| peek | ![]() |
returns value at the top of the heap |
| pop | ![]() |
removes the node at the top of the heap |
| push | ![]() |
inserts a node in its proper place in the heap |
| find | ![]() |
it is possible that the entire heap must be searched |
page_revision: 4, last_edited: 1195740486|%e %b %Y, %H:%M %Z (%O ago)








