Classic Binary Search Adventure
Time Complexity: O(log n) — Each step
halves the search space!
Space Complexity: O(1) — Only uses a few
pointers.
Requirement: Array must be SORTED
How it works: Compare the target with the middle element. If target is smaller, search the left half. If larger, search the right half. Repeat until found!
Binary Search found the treasure in O(log n) time!