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

asked in DS by Boss (8.6k points)   | 88 views

1 Answer

+4 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 (65.1k points)  
edited by


Top Users Mar 2017
  1. rude

    4768 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2728 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1572 Points

  7. Vignesh Sekar

    1422 Points

  8. Akriti sood

    1362 Points

  9. Bikram

    1334 Points

  10. Sanjay Sharma

    1126 Points

Monthly Topper: Rs. 500 gift card

21,516 questions
26,842 answers
61,138 comments
23,176 users