TRACING BACK A BINARY TREE
Keywords:
Binary tree, Inorder, Postorder and Preorder TraversalsAbstract
Binary tree is a nonlinear data structure, mainly used to represent data
containing a hierarchical relationship between elements. There are three standard ways of
traversing a binary tree, namely, preorder, inorder and postorder. The problem usually
faced is to find the original tree structure given either (a) Preorder and Inorder traversals
or (b) Postorder and Inorder traversals.
Some authors (e.g. Lipschutz) have given a method to trace back the original tree.
However, it is not suitable for solving the problem manually, especially when the total
number of nodes is large.
Hence, in this paper, stack oriented algorithms are presented for solving the above problem
and obtaining link representation of a binary tree.
The corresponding programs in ‘C’ language with output are also given.