in DS
330 views
3 votes
3 votes

i think option should be B if it is left skewed..same type questionhttps://gateoverflow.in/974/gate2006-13

in DS
330 views

1 Answer

7 votes
7 votes
Best answer

There is a minor difference between the 2 questions..In the previous year gate question , it is asked that :

Minimum size of an array required to store any binary tree with 'n' nodes

So we have to consider all sorts of binary trees ..Hence we are considering worst case which is skew binary tree                       which  takes space for n nodes     =    2n  -  1

But in the question mentioned here , it says :

 Minimum size an array may require to store a binary tree

So it is actually a weaker statement than the previous one..It considers the best case scenario actually..It is not considering all binary trees as it is not saying  "any binary tree"

So here we consider the best case which corresponds to complete binary tree..Hence n no of spaces required in an array for storing a binary tree..So the possible minimum size that an array may need to store a binary tree is 'n' only..

Hence A) is the correct answer..

selected by

Related questions