AlgoScope

Binomial Heap Merge

AlgorithmexpertHeap Operations

Merge two heaps by linking trees of equal degree like binary addition.

Decision · step 2 of 9Binomial and Fibonacci Heaps: Merge two binomial heaps
heap301045205512358

Degree 0: 2 trees, rooted at 55, 8. Two of a kind: link them, and the result is a B1 that joins the next degree.

Open in the player →or start at step 2

What you will see

Trees of equal size pair up and link; a carry propagates.

How binomial and fibonacci heaps works →

Cost

BestO(log n)
AverageO(log n)
WorstO(log n)
SpaceO(1)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next, try operations in any order.

Screen readers: Nodes announce value, parent and children; each step announces the comparison and whether the value moves up or down.

Reduced motion: Swaps become value crossfades in both the tree and the array view.

Before this

Taught by the same lesson

Binomial and Fibonacci Heaps covers these too, in the same run.