is denoted by $r(T)$. For any node $u \in V(T)$ with $u\neq r(T)$, consider the unique path from $u$ to $r(T)$ in $T$; the *ancestors* of $u$ are the nodes of such a path, the *proper ancestors* of $u$ are the ancestors different from $u$ itself, and the *parent* $p(u)$ of $u$ is the proper ancestor of $u$ which is adjacent to $u$. For any two nodes $u,v\in V(T)$, the *lowest common ancestor* is the ancestor of $u$ and $v$ whose graph-theoretic distance from $r(T)$ is maximum. For any node $u\in V(T)$ with $u\neq r(T)$, the *children* of $u$ are the neighbors of $u$ different from $p(u)$; the *children* of $r(T)$ are all its neighbors. The nodes that have children are called *internal*; a non-internal node is a *leaf*. For any node $u\in V(T)$ with $u\neq r(T)$, the *subtree* $T_u$ of $T$ rooted at $u$ is defined as follows: remove from $T$ the edge $(u,p(u))$, thus separating $T$ in two trees; the one containing $u$ is the subtree of $T$ rooted at $u$. If each node of $T$ has at most two children, then $T$ is a *binary tree*.

An *ordered rooted tree* is a tree that is rooted and 