A tree is, by definition, a partially ordered set. An ordered tree is a tree equipped with a linear extension. In other words, its a linear order on the nodes of the tree that obeys the parent-child relationship of the tree. By Zorn’s lemma, every tree can be ordered. When a tree is finite, the linear extension of the tree can be constructed inductively:
First, label the nodes of : each label is an -tuple of positive integers, for some ,
the root of is labeled ,
if a node of has been labeled , and if the children of are , then label each by .
From this labeling process, we see that the (direct) children of the root have labels . In general, if a node is of level , its label is a -tuple starting with . It is easy to see that each label corresponds to a unique node of : for if two distinct nodes are of different level, their labels are clearly different. However, if they are of the same level, then the last components of their labels are distinct.
Next, order the labels of the nodes lexicographically. In other words, given an -tuple and an -tuple , compare them componentwise, starting from the first. There are two cases:
either all components match, where , or
, but for all , where .
Then iff in the first case, or in the second. This ordering on the labels induces an ordering on the nodes: for nodes and with labels and ,
This ordering on the nodes is linear, and extends the partial ordering on .
For example, below are two diagrams of the same tree. The one on the right is labeled by the method above:
By ordering the labels, we get the corresponding ordering of the nodes:
|Date of creation||2013-03-22 19:00:11|
|Last modified on||2013-03-22 19:00:11|
|Last modified by||CWoo (3771)|