There are many applications of Binary Search. Some of them are listed below:
- Git bisect: Suppose we have a large number of commits and some particular commit is facing some errors, so instead of linear searching over all the commits, we can use git bisect which uses binary search to find out the commit causing the error.
- Find if a number is a square of any integer: To check if a number is a square of any integer, run a binary search from 1 to num and check if the square of mid is equal to num.
- Dictionary: In the dictionary, all the words are arranged in lexicographical order, therefore, to find a particular word, we can simply binary search to find the alphabets without having to go through each word.