A complete binary tree is a combinatorial structure built from an initial point (the root), from which two line segments (the branches, or edges) extend to two new points (the nodes), from each of which two more line segments extend, and so on. Successive nodes are arranged in levels; the nodes on level n are those reached by following n line segments from the root. The nodes on the final level, from which no more branches extend, are the tree's leaves.
These definitions closely resemble their counterparts in real trees—the wooden kind—the main formal difference being that, in combinatorics, trees usually have their roots at the top and their leaves at the bottom…
Now label each branch by the route from the root that reaches it, writing 0 for a move left and 1 for a move right. This label can be interpreted as the binary representation of a number (see box). At the lower endpoint of each edge, write the corresponding number in decimal. For example, 13 is the decimal value of "1101", the label on the edge reached by starting at the root, then going right (1), right again (1), left (0), and finally right (1).





