(a) Modify the preorder traversal of Section 5.2 to perform an inorder traversal of a binary tree....

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 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 D A G E C F H) O

(b) Modify the preorder traversal of Section 5.2 to perform a postorder traversal of a binary tree.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: