Binomial Trees
Binomial trees are the building blocks of binomial heaps. They are defined recursively and have a precise combinatorial structure that makes merging two heaps analogous to binary addition.
Recursive Definition
A binomial tree of order is defined:
- : a single node (the root, degree 0)
- (): formed by taking two trees and making the root of one the leftmost child of the root of the other
: one node. : root with one child (two trees). : root with two children (two trees merged). : root with three children (two trees merged).
Properties (Proof by Induction)
For :
| Property | Value | Induction |
|---|---|---|
| Number of nodes | Base: has 1. Step: | |
| Height | Base: height 0. Step: | |
| Root degree | Root has children (greater than any other node) | |
| Nodes at depth | Follows from recursive structure (Pascal’s triangle) | |
| Children of root | From left to right, by construction |
Depth Distribution
The binomial coefficient property gives the tree its name. The number of nodes at depth in is . This can be verified for small :
- : depth 0: , depth 1: , depth 2: , depth 3:
- Total nodes: ✓
Maximum Degree
Since has nodes and root degree , the maximum degree of any node in a binomial tree with nodes is . This bounds the height of bubble-up and bubble-down operations.
Heap Ordering
A binomial tree is heap-ordered if the key of each node is the key of each of its children (min-heap property). Since children are subtrees, this property must hold recursively.
When merging two heap-ordered trees, the root with the larger key becomes a child of the root with the smaller key. This preserves the heap property in time.
Binary Representation Connection
A binomial heap with items is a collection of binomial trees with distinct orders. The orders present correspond to the 1-bits in the binary representation of .
Example: . The heap contains (8 nodes), (4 nodes), and (1 node).
This binary structure is what makes merging two heaps analogous to binary addition (see Binomial Heap Structure).
Summary
| property | Value |
|---|---|
| Nodes | |
| Height | |
| Root degree | (maximum in tree) |
| Depth nodes | |
| Root’s children | |
| Max degree ( nodes) |
Past Tripos: y2024p2q7, y2023p1q9.