Please enable JavaScript.
Coggle requires JavaScript to display documents.
Heaps - Coggle Diagram
Heaps
Binary Tree
one key per node
and 2 conditions
is essentially complete
all levels full
might have some rightmost leaves missing on the last level
parental dominance
key is greater or equal to its children's
heigth log n base 2
Partially ordered Data Structure
Implementation
Priority Queues
Multiset of items with orderable characteristic
Uses
scheduling job executions by OS
traffic management by comms networks
Prim's algorithm
Dijkstra's algorithm
Huffman encoding
Branch-and-Bound applications
HeapSort
heap construction + maximum deletions
array elements eliminated in decreasing order
deleted = placed last
array in increasing order
O(n) + O (nlogn) = O(nlogn)
same as merge but better in space efficiency
it's slower than quicksort (in unordered arrays)
Root = largest element
node with descendents is also a heap
array 1 to n