retagged by
412 views

1 Answer

Best answer
4 votes
4 votes
$T(n) = T(n/2) + 1$

This is the recurrence relation as after '1' search we eliminate $n/2$ elements.

Solving we get

$T(n) = T(n/2) + 1 \\= T(n/2^2) + 2 \\= \dots \\=T(n/2^{\lg n}) + \lg n \\= T(1) + \lg n \\= 1 + \lg n$
selected by

Related questions

0 votes
0 votes
2 answers
1
dhruba asked Jun 5, 2023
1,227 views
Binary search is performed on a sorted array of n elements. The search key is not in the array and falls between the elements at positions m and m+1 (where 1 ≤ m < n). ...
4 votes
4 votes
1 answer
2
Aghori asked Nov 5, 2017
1,245 views
There are two sorted list each of length $n$. An element to be searched in the both the lists. The lists are mutually exclusive. The maximum number of comparisons require...