The GATE Grind

GATE 2007 CS – Question 47

Programming and Data Structures · Binary Heaps · 2 marks · Multiple choice

A max-heap is an array. To insert a new element, binary search the path from new leaf to root for its position. How many comparisons are performed?

  1. $\Theta(\log_2n)$
  2. $\Theta(\log_2\log_2n)$
  3. $\Theta(n)$
  4. $\Theta(n\log_2n)$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) $\Theta(\log_2\log_2n)$

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More Binary Heaps questions

All Binary Heaps questions →