GATE CS 2007 · Linear Search & Binary Search

MCQ · 1 mark · Problem PROG-SRCH-0015

Consider the process of inserting an element into a Max Heap, where the Max Heap is represented by an array. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of comparisons performed is:
  1. A
    \(\Theta (log n)\)
  2. B
    \(\Theta (loglogn)\)
  3. C
    \(\Theta (n)\)
  4. D
    \(\Theta (n log_{2}n)\)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1245/gate2007-47

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com