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:
- A
\(T(n)=2 T\left(\frac{n}{2}\right)+k, \mathrm{k} \text { is a constant }\)
- B
\(T(n)=T\left(\frac{n}{2}\right)+k, \mathrm{k} \text { is a constant }\)
- C
\(T(n)=T\left(\frac{n}{2}\right)+\log n\)
- D
\(T(n)=T\left(\frac{n}{2}\right)+n\)
Solve it on GATE DA practice →More Searching & Sorting Algorithms problems
Show the worked solution
Official 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