Definition:Pre-Order Traversal of Labeled Tree

Definition
Let $T$ be a binary labeled tree.

Pre-order traversal of $T$ is an algorithm designed to obtain a string representation of $T$.

The steps are as follows:

$\mathtt{Preorder} (T):$
 * $n \gets t$, where $t$ is the root node of $T$.
 * Output the label of $n$.
 * If $n$ is a leaf node, stop.
 * Let $T_1$ and $T_2$ be the left and right subtrees of $T$.
 * If $n$ has only one child, skip this step. Output $\mathtt{Preorder} (T_1)$.
 * Output $\mathtt{Preorder} (T_2)$.
 * Stop.

The resulting string will be in Polish notation.