First time here? Checkout the FAQ!
+2 votes

asked in DS by Boss (8.6k points)   | 86 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 (65k points)  
edited by
Top Users Feb 2017
  1. Arjun

    5502 Points

  2. Bikram

    4266 Points

  3. Habibkhan

    3972 Points

  4. Aboveallplayer

    3046 Points

  5. Debashish Deka

    2646 Points

  6. sriv_shubham

    2328 Points

  7. Smriti012

    2270 Points

  8. Arnabi

    2134 Points

  9. sh!va

    1938 Points

  10. mcjoshi

    1752 Points

Monthly Topper: Rs. 500 gift card

20,936 questions
26,054 answers
22,209 users