Luxembourg
5
Q:

binary search time complexity

Length of array = n
0
=> log2 (n) = log2 (2k)
=> log2 (n) = k log2 (2)
0
=> k = log2 (n)
0
Average case:O(log n)
Best case:O(1)
0

New to Communities?

Join the community