GATE CS 1994 · Linear Search & Binary Search

MCQ · 1 mark · Problem PROG-SRCH-0011

The recurrence relation that arises in relation with the complexity of binary search is:
  1. A
    \(T(n)=2 T\left(\frac{n}{2}\right)+k, \mathrm{k} \text { is a constant }\)
  2. B
    \(T(n)=T\left(\frac{n}{2}\right)+k, \mathrm{k} \text { is a constant }\)
  3. C
    \(T(n)=T\left(\frac{n}{2}\right)+\log n\)
  4. D
    \(T(n)=T\left(\frac{n}{2}\right)+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/2444/gate1994-1-7-isro2017-14

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