Question: (a) Modify the preorder traversal of Section 5.2 to perform an inorder traversal of a binary tree. Section 5.2 The preorder enumeration for the tree
(a) Modify the preorder traversal of Section 5.2 to perform an inorder traversal of a binary tree.
Section 5.2
The preorder enumeration for the tree of Figure 5.1 is ABDCEGFHI: The first node printed is the root. Then all nodes of the left subtree are printed (in preorder) before any node of the right subtree.

(b) Modify the preorder traversal of Section 5.2 to perform a postorder traversal of a binary tree.
B D A G E C F H) O
Step by Step Solution
3.45 Rating (155 Votes )
There are 3 Steps involved in it
To perform an inorder traversal of a binary tree you visit nodes in the following order 1 Traverse t... View full answer
Get step-by-step solutions from verified subject matter experts
