What is the best and worst case of binary search?
Answers
Answered by
0
Best case is O(1). You could get lucky and the element you want is in the middle of the list. Worst case is O(log2(n)) as the number of times you can divide the list up in 2 is the maximum times you'll have to compare elements in a binary search. Average case is also O(log2(n)). The average number of times ...
Similar questions