C19-binomial - Chapter 19: Binomial Heaps We will study...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Chapter 19: Binomial Heaps We will study another heap structure called, the binomial heap. The binomial heap allows for efficient union, which can not be done efficiently in the binary heap. The extra cost paid is the minimum operation, which now requires O (log n ). 1 Comparison of Efficiency Binary Binomial Procedure (worst- (worst- case) case) Make- Heap Θ(1) Θ(1) Insert Θ(lg n ) O (lg n ) Minimum Θ(1) O (lg n ) Extract- Min Θ(lg n ) Θ(lg n ) Union Θ( n ) O (lg n ) Decrease- Key Θ(lg n ) Θ(lg n ) Delete Θ(lg n ) Θ(lg n ) 2 Definition A binomial tree B k is an ordered tree defined recursively. • B consists of a single node. • For k ≥ 1, B k is a pair of B k- 1 trees, where the root of one B k- 1 becomes the leftmost child of the other. 3 B 1 B 2 B 3 B 4 B k B k-1 B k-1 B 4 Properties of Binomial Trees Lemma A For all integers k ≥ 0, the following properties hold: 1. B k has 2 k nodes. 2. B k has height k . 3. For i = 0 , . . . , k , B k has exactly k i nodes at depth i . 4. The root of B k has degree k and all other nodes in B k have degree smaller than k . 5. If k ≥ 1, then the children of the root of B k are B k- 1 , B k- 2 , ··· , B from left to right. Corollary B The maximum degree of an n-node binomial tree is lg n ....
View Full Document

This note was uploaded on 04/09/2010 for the course CS 12345 taught by Professor Thomas during the Spring '10 term at École Normale Supérieure.

Page1 / 24

C19-binomial - Chapter 19: Binomial Heaps We will study...

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

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