GATE DA 2024 · Linear Search & Binary Search

MCQ · 2 marks · Problem PROG-SRCH-0005

Let \(F(n)\) denote the maximum number of comparisons made while searching for an entry in a sorted array of size \(n\) using binary search. Which ONE of the following options is TRUE?
  1. A
    \(F(n)=F(\lfloor n / 2\rfloor)+1\)
  2. B
    \(F(n)=F(\lfloor n / 2\rfloor)+F(\lceil n / 2\rceil)\)
  3. C
    \(F(n)=F(\lfloor n / 2\rfloor)\)
  4. D
    \(F(n)=F(n-1)+1\)

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

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/422932/gate-ds%26ai-2024-question-30

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