29 votes 29 votes The recurrence relation that arises in relation with the complexity of binary search is: $T(n) = 2T\left(\frac{n}{2}\right)+k, \text{ k is a constant }$ $T(n) = T\left(\frac{n}{2}\right)+k, \text{ k is a constant }$ $T(n) = T\left(\frac{n}{2}\right)+\log n$ $T(n) = T\left(\frac{n}{2}\right)+n$ Algorithms gate1994 algorithms recurrence-relation easy isro2017 + – Kathleen asked Oct 4, 2014 • recategorized Apr 25, 2021 by Lakshman Bhaiya Kathleen 18.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
5 votes 5 votes Its Option B. Because, in binary search we reduce the search space into half at each comparison. For more information check out link below... just to get an idea on how binary search works https://www.flowerbrackets.com/binary-search-java/ Hope it helps!!! Siddarth answered Oct 10, 2017 • edited Jul 29, 2019 by Siddarth Siddarth comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Since, with every iteration of binary search, data set to be searched is divided into half of the original data set.Also,some constant time is lapsed during iteration during each iteration.So, recurrence relation for Binary search would be: T(n) = T(n/2) + k, where k is a constant. akshay_123 answered Dec 6, 2023 akshay_123 comment Share Follow See all 0 reply Please log in or register to add a comment.
–1 votes –1 votes They are asking about Binary search that is when array is already sorted with distinct element we can directly jump to middle and after comparing middle we can either go peft or go right we have to follow one path.. Ie T(n2) + k Sandeep Suri answered Jan 9, 2018 Sandeep Suri comment Share Follow See all 0 reply Please log in or register to add a comment.