• recategorized by
1,091 views

1 Answer

4 4 votes

Max element in min heap will present at leaf node.

Min heap has 2048 elements.

#leaf nodes = $\left \lceil 2048/2 \right \rceil$ = 1024

So in total min number of comparisons needed = 1024 – 1 = 1023

 

PS: Good thing to remember, In a binary heap of ‘n’ nodes there are exactly $\left \lceil n/2 \right \rceil$ leaf nodes.

Refer: https://stackoverflow.com/questions/40665736/how-do-you-prove-there-are-ceiln-2-leaves-in-a-binary-heap-of-n-nodes

• edited by
Answer:
Position:
Show:

Related questions

2 2 votes
1 answers 1 answer
1.3k
1.3k views
LRU asked Nov 3, 2021
1,319 views
The time required to determine the minimum element from the max heap of size O(log(n)) is given by
2 2 votes
1 answers 1 answer
1.3k
1.3k views
LRU asked Nov 22, 2021
1,347 views
Number different of binary search trees which can be created with the elements {12, 34, 22, 43, 13, 45, 55, 94, 99, 23} with 45 as the root is___.
1 1 vote
1 answers 1 answer
891
891 views
LRU asked Oct 4, 2021
891 views
Worst case time required to construct a balanced BST given a sorted array of integers which can be inserted in any order
5 5 votes
1 answers 1 answer
1.5k
1.5k views
LRU asked Nov 5, 2021
1,485 views
Given the following undirected graph, the cost of the minimal spanning tree of the graph is ____.