Awesome q2a theme
+1 vote
16 views
1) Time complexity to construct a Binary tree when inorder and preorder/postorder traversal of the tree is given.

a) if inorder sorted

b) if inorder is not sorted.

 

2) If construct Binary tree when pre-order and postorder to the tree is given.

.....…

My answer:

1 a) O( nlogn)

1 b) O(nlogn)

2) O(2^n)

Please check and correct

Thanks
in Algorithms by (9 points) | 16 views
0

 construct Binary tree when pre-order and postorder to the tree is given

Just any binary tree cause a unique tree will not be possible?

0
Also shouldn’t (a) and (b) be $n^2$? Give your algorithm please.

Please log in or register to answer this question.

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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
9,211 questions
3,186 answers
14,687 comments
96,181 users