Overview - Why Binary Search and What Sorted Order Gives You
What is it?
Binary search is a method to find an item in a list by repeatedly dividing the search area in half. It works only if the list is sorted in order. Sorted order means the items are arranged from smallest to largest or vice versa. This method quickly narrows down where the item could be, instead of checking every item one by one.
Why it matters
Without binary search, finding an item in a large list would take a long time because you might have to look at every item. Binary search makes searching much faster, saving time and computing power. Sorted order is important because it allows binary search to know which half of the list to ignore, making the search efficient. Without sorting, binary search cannot work.
Where it fits
Before learning binary search, you should understand simple searching methods like linear search and the concept of sorting. After binary search, you can learn about more advanced search trees and algorithms that build on the idea of dividing search space, like balanced trees and interpolation search.
