The Gateway to Computer Science Excellence
+2 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 and post-order 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?
in DS by Active | 284 views

3 Answers

+1 vote
Best answer


by Boss
selected by
+3 votes

5 will be answer 

by Boss
Please help me out , how did u approach this problem?

 see here

5 correct...1.inorder (left root right) ,postorder(left right root)...means last element in postorder would be root....then in inorder element before root  would be left sub tree and after root element would be right subtree...again same procedure...
0 votes
5 and the leaf nodes are a,c,e,h,j
by Active

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,223 questions
59,811 answers
118,087 users