1 Binomial Heaps Binomial- -Heap Heap- -Union Union Binomial - - PDF document

1
SMART_READER_LITE
LIVE PREVIEW

1 Binomial Heaps Binomial- -Heap Heap- -Union Union Binomial - - PDF document

Binomial Heaps Binomial trees Binomial Heaps Binomial trees Def. For each non-negative integer k, a binomial tree B k of root degree k is an ordered tree defined recursively as follow: 1) B 0 consists of a single node 2) B k consists of two


slide-1
SLIDE 1

1

Binomial Heaps Binomial Heaps Binomial trees Binomial trees

Def. For each non-negative integer k, a binomial tree Bk of root degree k is an

  • rdered tree defined recursively as follow:

1) B0 consists of a single node 2) Bk consists of two binomial trees Bk-1 linked together such that the root of one is the left child of the root of the other.

Binomial Trees Binomial Trees Properties of Binomial Trees Properties of Binomial Trees

Lemma. For the binomial tree

  • 1. The number of nodes of is
  • 2. Height( ) =

3. has exactly nodes at level , for

  • 4. The root degree of is greater than the

degree of every other node in . If the children of the root are numbered from right to left by then child is the root of subtree

k

B 2k

k

B

k

B

k

B

k

B

k

B k

k i      

i 0,1, , i k = … 0,1, , 1 k − … i

i

B A Binomial Heap A Binomial Heap Binomial tree B Binomial tree B4

4 with nodes labeled

with nodes labeled in binary by a in binary by a postorder postorder walk walk

slide-2
SLIDE 2

2

Binomial Heaps Binomial Heaps Binomial Binomial-

  • Heap

Heap-

  • Union

Union Binomial Binomial-

  • Heap

Heap-

  • Union

Union Binomial Binomial-

  • Heap

Heap-

  • Union (cont.)

Union (cont.) Binomial Binomial-

  • Heap

Heap-

  • Union

Union Binomial Heaps Binomial Heaps

slide-3
SLIDE 3

3

Binomial Binomial-

  • Heap

Heap-

  • Extract

Extract-

  • Min

Min Binomial Heaps Binomial Heaps Binomial Binomial-

  • Heap

Heap-

  • Decrease

Decrease-

  • Key

Key