lec12 - Binomial Heaps Leftist trees O(log n) O(log n)...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Binomial Heaps Binomial heaps Leftist trees Insert O(log n) O(1) O(1) Remove min (or max) O(log n) O(n) O(log n) Meld O(log n) O(1) O(1)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Min Binomial Heap Collection of min trees. 6 4 9 5 8 7 3 1 9 5 6 5 9 2 8 6 7 4
Background image of page 2
Node Structure Degree Number of children. Child Pointer to one of the node’s children. Null iff node has no child. Sibling Used for circular linked list of siblings. Data
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Binomial Heap Representation Circular linked list of min trees. 6 4 9 5 8 7 3 1 9 5 6 5 9 2 8 6 7 4 A Degree fields not shown.
Background image of page 4
Insert 10 Add a new single-node min tree to the collection. 10 Update min-element pointer if necessary. 6 4 9 5 8 7 3 1 9 5 6 5 9 2 8 6 7 4 A
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Meld Combine the 2 top-level circular lists. 9 5 7 A 4 8 7 3 1 B Set min-element pointer.
Background image of page 6
Meld 9 5 7 4 8 7 3 1 C
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Remove Min Empty binomial heap => fail.
Background image of page 8
Nonempty Binomial Heap Remove a min tree. Reinsert subtrees of removed min tree. Update binomial heap pointer.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2010 for the course COT 5536 taught by Professor Sartajsahani during the Spring '10 term at University of Florida.

Page1 / 33

lec12 - Binomial Heaps Leftist trees O(log n) O(log n)...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online