Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Binomial Heaps
Binomial Trees
Definition
properties
Binomial Heaps
efficient merging
Implementation
Operations
About Midterm
Binary Heaps
Binary Heaps
efficient findMin, deleteMin
many applications
Binomial Heaps
Efficient merge of two heaps
Merging two heap based data
structures
Binomial Heap is build using a
structure called Binomial Trees
Binomial Trees
B B B B
0 1 2 3
Merging two binomial trees
=
+
Proof:
implementation
Implementation Binomial Tree Node
head
Insert
make a new heap H0 with the new
node
Merge(H0, H)
FindMin
min is one of the children connected to
the root
cost is O(log n)
Binary Heap Operations
DeleteRoot()
Find the tree with the given root
Split the heap into two heaps H1 and
H2
Binary Heap Operations
DeleteRoot() ctd..
Rearrange binomial trees in heap H2
Merge the two heaps
v v
Example
DeleteNode()
Two heaps
Binary Heaps
deleteMin()
Binomial Heaps
mergeHeaps()
Next Week
Midterm on Tuesday
Strings and Tries on thursday