6 votes 6 votes A binary min-heap contains keys 1,2,3,4.....2047,2048 What is smallest key that can be at leaf node.?? DS data-structures binary-heap numerical-answers + – Ravi_1511 asked Feb 3, 2017 recategorized Jul 7, 2022 by Lakshman Bhaiya Ravi_1511 825 views answer comment Share Follow See 1 comment See all 1 1 comment reply Vijay Thakur commented Feb 4, 2017 reply Follow Share This tree has 2048 keys it means it will have 12 levels, 11 levels will be completely filled and there will be one node at 12 th level. In min heap kth smallest element can be up to k levels, I think answer should be 11 because 11 can be anywhere UpTo 11 levels. Confirm the answer? 3 votes 3 votes Please log in or register to add a comment.
Best answer 7 votes 7 votes This tree has 2048 keys it means it will have 12 levels, 11 levels will be completely filled and there will be one node at 12 th level. In min heap kth smallest element can be up to k levels, I think answer should be 11 because 11 can be anywhere UpTo 11 levels. Vijay Thakur answered Feb 4, 2017 edited Feb 4, 2017 by Vijay Thakur Vijay Thakur comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments Prajwal Bhat commented Feb 4, 2017 reply Follow Share Ohh Yes, I missed that sentence :( Thanks 0 votes 0 votes Ravi_1511 commented Feb 4, 2017 reply Follow Share Ok thanx..12th key may be on 12th level as leaf node but since smallest key at leaf is asked so we will get 11th key at 11th level somewhere..is it so.? 0 votes 0 votes ankeshsingh commented Oct 11, 2020 reply Follow Share How 11 is the answer not 12. Please explain in detail. I am not getting. 0 votes 0 votes Please log in or register to add a comment.