Skip to content
Part IA Lent Term

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 BkB_k of order kk is defined:

  • B0B_0: a single node (the root, degree 0)
  • BkB_k (k1k \ge 1): formed by taking two Bk1B_{k-1} trees and making the root of one the leftmost child of the root of the other

Binomial tree construction

B0B_0: one node. B1B_1: root with one child (two B0B_0 trees). B2B_2: root with two children (two B1B_1 trees merged). B3B_3: root with three children (two B2B_2 trees merged).

Properties (Proof by Induction)

For BkB_k:

PropertyValueInduction
Number of nodes2k2^kBase: B0B_0 has 1. Step: 22k1=2k2 \cdot 2^{k-1} = 2^k
HeightkkBase: B0B_0 height 0. Step: 1+(k1)=k1 + (k-1) = k
Root degreekkRoot has kk children (greater than any other node)
Nodes at depth dd(kd)\binom{k}{d}Follows from recursive structure (Pascal’s triangle)
Children of rootBk1,Bk2,,B0B_{k-1}, B_{k-2}, \ldots, B_0From left to right, by construction

Depth Distribution

The binomial coefficient property gives the tree its name. The number of nodes at depth dd in BkB_k is (kd)\binom{k}{d}. This can be verified for small kk:

  • B3B_3: depth 0: (30)=1\binom{3}{0} = 1, depth 1: (31)=3\binom{3}{1} = 3, depth 2: (32)=3\binom{3}{2} = 3, depth 3: (33)=1\binom{3}{3} = 1
  • Total nodes: 1+3+3+1=8=231 + 3 + 3 + 1 = 8 = 2^3

Maximum Degree

Since BkB_k has 2k2^k nodes and root degree kk, the maximum degree of any node in a binomial tree with nn nodes is log2n\le \log_2 n. 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 \le the key of each of its children (min-heap property). Since children are Bk1,,B0B_{k-1}, \ldots, B_0 subtrees, this property must hold recursively.

When merging two heap-ordered BkB_k trees, the root with the larger key becomes a child of the root with the smaller key. This preserves the heap property in O(1)O(1) time.

Binary Representation Connection

A binomial heap with NN items is a collection of binomial trees with distinct orders. The orders present correspond to the 1-bits in the binary representation of NN.

Example: N=13=11012=8+4+1=23+22+20N = 13 = 1101_2 = 8 + 4 + 1 = 2^3 + 2^2 + 2^0. The heap contains B3B_3 (8 nodes), B2B_2 (4 nodes), and B0B_0 (1 node).

This binary structure is what makes merging two heaps analogous to binary addition (see Binomial Heap Structure).

Summary

BkB_k propertyValue
Nodes2k2^k
Heightkk
Root degreekk (maximum in tree)
Depth dd nodes(kd)\binom{k}{d}
Root’s childrenBk1,Bk2,,B0B_{k-1}, B_{k-2}, \ldots, B_0
Max degree (nn nodes)log2n\le \log_2 n

Past Tripos: y2024p2q7, y2023p1q9.