recategorized by
2,926 views
0 votes
0 votes
Post order traversal of a BST is 35,50,55,60,50,100.then what can you say about the tree?

(A) Min heap

(B) Max heap

(C) Strict binary tree

(D) None of these
recategorized by

2 Answers

3 votes
3 votes

Max Heap : max-heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node.

Min -Heap : A min-heap is a binary tree such that. - the data contained in each node is less than (or equal to) the data in that node's children.

Strict Binary Tree : A full binary tree (sometimes proper binary tree or 2-tree or strictly binary tree) is a tree in which every node other than the leaves has two children.

Let's Construct the tree from give post order Traversal.

From the above definitions and tree we can see this tree doesn't satisfy the conditions of any definition.

Hence,Option(D)None of these is the correct choice.

1 votes
1 votes
since 100 coming in last it can not be min heap so choice a) is out

if we consider it as max heap then 35 50 55 but 60 50 is not possible so choice b ) is also out

choice c) is strictly binary tree which although has nothing to do with values directly but it can not be strictly binary as the highest value is at last so it will be left skewed nothing will be at right so root will have only one child which violates the definition of strictly binary tree

hence ans is D

Related questions

2 votes
2 votes
2 answers
1
1 votes
1 votes
2 answers
2
akankshadewangan24 asked Jul 10, 2017
402 views
how to make binary search tree from the given post order traversal1,2,3,4................n if no inorder or preorder is mentioned?????????//