From 211b76591f2a35aa4234a7b1554abac8c4d10a0c Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Thu, 7 Oct 2021 14:32:03 +0200 Subject: Define tree traversals --- mgr.tex | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mgr.tex') diff --git a/mgr.tex b/mgr.tex index 65e596a..7074ec3 100644 --- a/mgr.tex +++ b/mgr.tex @@ -115,6 +115,22 @@ Binary trees are trees where each node has either no children (the node is a leaf), or exactly two children (which, based on their order, can be called the left and the right child). +The \definedterm{post-order} of $V(T)$ is an ordering of $T$'s vertices produced +by the following recursive procedure: + +\begin{enumerate} + \item First traverse the root's subtrees. + \item Visit the root. +\end{enumerate} + +Similarly, the \definedterm{pre-order} of $V(T)$ is produced by the following +recursive procedure: + +\begin{enumerate} + \item First visit the root. + \item Traverse the root's subtrees. +\end{enumerate} + \subsection{Tree automata} Consider the case of binary trees labeled with $\Sigma$. A -- cgit v1.2.3