0 votes 0 votes Algorithms algorithms binary-search + – Miny asked Jul 24, 2015 • retagged Jun 24, 2022 by makhdoom ghaya Miny 412 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
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$ Arjun answered Jul 24, 2015 • selected Jul 24, 2015 by Happy Mittal Arjun comment Share Follow See 1 comment See all 1 1 comment reply Ishan commented Jul 26, 2015 reply Follow Share you can also solve the recurrence by masters theorem 1 votes 1 votes Please log in or register to add a comment.