Рет қаралды 14,486
Here we look at Binary Search, and how it compares to linear search. Binary search works by searching at the middle value, and seeing if it's smaller or greater than the value we are searching for. It then segments the list and repeats and finishes binary search when the item is found.
I implemented the algorithm in python iteratively as a demonstration, but it can be implemented in any other language like c, c# or java and can be implemented recursively.