Question: (a) Assume that you are given both the preorder and post order traversal of some binary tree t. Prove that this information, taken together, is

(a) Assume that you are given both the preorder and post order traversal of some binary tree t. Prove that this information, taken together, is not necessarily sufficient to reconstruct t uniquely, even if each value in t occurs only once.

(b) Now, assume that you have the preorder and in order traversals of a tree (given below). Construct the corresponding binary tree and determine its post order traversal.

  • Preorder Traversal: D C B A F E

  • In order Traversal: C A B D E F

Step by Step Solution

3.37 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Consi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!