recategorized by
14,032 views
1 votes
1 votes

_____  traversals are not sufficient to build a binary tree.

  1. Preorder and Inorder
  2. Postorder and Inorder
  3. Postorder and Preorder
  4. None of these
recategorized by

3 Answers

1 votes
1 votes

C is correct. 

We can't build a tree without the in-order traversal. Why?

This is so because we cannot separate the left sub-tree and right sub-tree using the pre-order or post-order traversal alone.

Even if we have all three i.e. Prorder, Postorder and Level Order we cannot get unique tree.

Ref: https://stackoverflow.com/questions/33062228/why-it-is-impossible-to-construct-binary-tree-with-pre-order-post-order-and-lev

 

1 votes
1 votes
We can't build a tree without the in-order traversal.
Consider two different trees,
TREE-1
root=a;
root→ left=b;
root→ left→ right=c;
TREE-2
root=a;
root→ right=b;
root→ right→ left=c;
Both the trees are different, but have same pre-order and post-order sequence.
pre-order - a b c
post-order - c b a
Because we cannot separate the left subtree and right subtree using the pre-order or post-order traversal alone
Answer:

Related questions

2 votes
2 votes
4 answers
1
Arjun asked Apr 22, 2018
6,414 views
If $\text{Tree-1}$ and $\text{Tree-2}$ are the trees indicated below:Which traversals of $\text{Tree-1}$ and $\text{Tree-2}$, respectively, will produce the same sequence...
1 votes
1 votes
3 answers
2
Arjun asked Dec 7, 2018
1,291 views
The smallest element that can be found in time ____ in a binary max heap.$O(n \log n)$$O( \log n)$$O(n)$$O(n^2)$
5 votes
5 votes
5 answers
3
Arjun asked Dec 7, 2018
2,143 views
______ to evaluate an expression without any embedded function calls.Two stacks are requiredone stack is neededThree stacks are requiredMore than three stacks are require...
1 votes
1 votes
2 answers
4
Arjun asked Dec 7, 2018
3,450 views
For a given hash table $T$ with $10$ slots that stores $1000$ elements, the load factor $\alpha$ for $T$ is$100$$0.01$$200$$1.05$