The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+2 votes
193 views
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 (3.1k points) | 193 views

3 Answers

+1 vote
Best answer

....

by Boss (13.3k points)
selected by
+3 votes

5 will be answer 

by Boss (18.5k points)
0
Please help me out , how did u approach this problem?
0

 see here

0
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 (1.3k points)

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
50,339 questions
55,765 answers
192,355 comments
90,815 users