Docsity

Binomial Tree and Heap: Definition, Merge Operation, and Insertion - Prof. Jun Huan, Study notes of Data Structures and Algorithms

Partial preview of the text

Download Binomial Tree and Heap: Definition, Merge Operation, and Insertion - Prof. Jun Huan and more Study notes Data Structures and Algorithms in PDF only on Docsity!

Binomial Tree Definition • B 0 is a single node

  • • BBinomial tree has heap-order propertyk is defined recursively

Bk B 0 Bk- Binomial heap is a set of binomial trees with different ranks

Binomial Tree Binomial Heap Yes Yes

Yes Yes

No No

No Yes

B

B

B

B

Rule II: Merge two trees with same size Select the one with the smallest root, and attach the other one to the root as the right most child example 1:

example2:

Insert 6:

DeleteMin:

1.2. Find the Min RootDelete the Root

  1. Merge Example:

Deleting the min:

Merging: Step1: