GATE CSE
First time here? Checkout the FAQ!
x
+2 votes
83 views

asked in DS by Boss (8.4k points)   | 83 views

1 Answer

+3 votes

Almost Complete Binary Tree is Complete Binary Tree In Which Last Level Strictly Is Not Full

A complete binary tree is one in which:

a) All levels of the tree (except last level possibly) are full..

b) The nodes in the last level  are arranged in a left to right manner..

So as we have said that last level is not full necessarily..So this means the child pointers of some of the earlier level nodes will also remain empty and hence they will be leaf nodes as well.

Hence a leaf node can be either in the last level or 2nd last level.Hence statement (i) is true..

Now coming to the second statement , it uses the second property that is mentioned for this type of tree..It is saying about right descendents of a given node which is present in the last level , so this means say this right descendent is at the position 10 with respect to left most node in the last level..So compulsorily the left descendent of that particular node will be at less than 10th position w.r.t left most node of last level will be present in the almost complete binary tree..So consequently the left descendent of which we are talking about will be any of these nodes in the last level and hence at depth d..

Hence statement (ii) is true as well.

Hence C) is the correct option..

answered by Veteran (59.7k points)  
edited by
Top Users Jan 2017
  1. Debashish Deka

    9614 Points

  2. sudsho

    5554 Points

  3. Habibkhan

    4878 Points

  4. Bikram

    4774 Points

  5. Vijay Thakur

    4498 Points

  6. Arjun

    4408 Points

  7. saurabh rai

    4236 Points

  8. Sushant Gokhale

    4112 Points

  9. Kapil

    3830 Points

  10. santhoshdevulapally

    3808 Points

Monthly Topper: Rs. 500 gift card

19,371 questions
24,203 answers
53,828 comments
20,368 users