First time here? Checkout the FAQ!
+2 votes

asked in DS by Boss (8.6k points)   | 92 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.9k points)  
edited by

Top Users Apr 2017
  1. akash.dinkar12

    3796 Points

  2. Divya Bharti

    2716 Points

  3. Deepthi_ts

    2292 Points

  4. rude

    2142 Points

  5. Tesla!

    1888 Points

  6. Kapil

    1786 Points

  7. Sanjay Sharma

    1702 Points

  8. Debashish Deka

    1690 Points

  9. Prashant.

    1624 Points

  10. Arjun

    1614 Points

Monthly Topper: Rs. 500 gift card

22,147 questions
28,145 answers
24,301 users