Binary Search is like opening a physical dictionary right in the middle! Because the array is already sorted, every single comparison cuts your search space in half.
How it Works Step-by-Step:
1Look Right at the Middle: Calculate the exact middle index (mid) between your left and right bounds.
2Compare with Target:
If middle value equals target ➔ Target Found! 🎉
If middle value is smaller âž” Throw away the left half (low = mid + 1).
If middle value is larger âž” Throw away the right half (high = mid - 1).
3Repeat Until Found: Keep halving the search space until you find the target or run out of numbers (low > high).
🎯 Real-World Analogy: The 1-to-100 Number Guessing Game
Imagine guessing a secret number between 1 and 100. If your first guess is 50 and the host says "Too Low!", you instantly eliminate numbers 1 through 50! Your next guess is 75 (middle of 51 to 100). By always guessing the middle, you can find any number out of 100 in just **7 guesses or fewer**!