binary search time complexity
snippet in c

binary search time complexity

user911

Average case:O(log n)
Best case:O(1)

binary search time complexity

user1056

=> k = log2 (n)
 

binary search time complexity

user5018

Length of array = n

binary search time complexity

user2987

=> k = log2 (n)

binary search time complexity

user7291

=> log2 (n) = log2 (2k)
=> log2 (n) = k log2 (2)