9. There are three different tree traversals for binary trees, which are in-order traversal, pre-order traversal and post-order traversal. If pre-order traversal and post-order traversal are provided,...


9. There are three different tree traversals for binary trees, which are in-order traversal,<br>pre-order traversal and post-order traversal. If pre-order traversal and post-order<br>traversal are provided, it is found that in some cases, the in-order traversal is not unique.<br>Construct an example, with exactly 3 nodes, that pre-order traversal and post-order<br>traversal can give a unique in-order traversal.<br>Construct another example, with exactly 3 nodes, that pre-order traversal and<br>post-order traversal cannot give a unique in-order traversal.<br>c. State and explain the necessary and sufficient condition that a unique in-order<br>traversal can be deduced from given both pre-order traversal and post-order<br>traversal.<br>

Extracted text: 9. There are three different tree traversals for binary trees, which are in-order traversal, pre-order traversal and post-order traversal. If pre-order traversal and post-order traversal are provided, it is found that in some cases, the in-order traversal is not unique. Construct an example, with exactly 3 nodes, that pre-order traversal and post-order traversal can give a unique in-order traversal. Construct another example, with exactly 3 nodes, that pre-order traversal and post-order traversal cannot give a unique in-order traversal. c. State and explain the necessary and sufficient condition that a unique in-order traversal can be deduced from given both pre-order traversal and post-order traversal.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here