Why is binary search O(log n) and not O(n/2)?
Binary search halves the list each time, so my first instinct was that it does about n/2 work. I know the answer is log n but I cannot see where the logarithm comes from, and halving once really does remove half the list.
What is the quantity that the logarithm is counting?