edited by
2,238 views
10 votes
10 votes

Let $T$ be a rooted binary tree whose vertices are labelled with symbols $a, b, c, d, e, f, g, h, i, j, k$. Suppose the in-order (visit left subtree, visit root, visit right subtree) and post-order (visit left subtree, visit right subtree, visit root) traversals of $T$ produce the following sequences.

in-order:$a, b, c, d, e, f, g, h, i, j, k$

post-order:$a, c, b, e, f, h, j, k, i, g, d$

How many leaves does the tree have?

  1. THREE.
  2. FOUR.
  3. FIVE.
  4. SIX.
  5. Cannot be determined uniquely from the given information.
edited by

2 Answers

Best answer
14 votes
14 votes

We can construct binary tree by postorder and inorder traversal

There we get $5$ leaves of the tree  are $a,c,e,h,j$

So, answer (C) $5$

edited by
Answer:

Related questions

42 votes
42 votes
4 answers
2