It is known that binary search takes t units of time in the worst case for a sorted array of size n. How long will the algorithm take in the worst case if input size is n/2?
worse case time complexity for binary search
524 views Asked by Ramandeep Singh At
1
Our new input differs from the original input by a factor of 2. Because the worst-case time of binary search is known to have a logarithmic complexity, the asymptotic upper bound on the time should be the same. This should hold true for any input that's a multiple of 2 of the original.