lecture08-ruth





































After class someone asked what would happen if you merged a Binomial Queue with 3 nodes with the final answer to the previous merge shown above. This is just a "1" case for both height 0 and height 1 - you simply accept the Binomial trees of height 0 and height 1 into those locations in the merged tree. The tree of height 4 also is a case "1" that just goes into location 4 in the merged tree.

After class someone asked how you would end up with the "3" case. Modifying the example we did in class by adding in another binomial tree of height 1 is one way (shown below with root 4). After merging the two trees of height zero (the single nodes 3 and 21, a case "2") you end up with a third tree of height 1.