Binary Search is used to search for a key in a sorted array. It is a Divide and conquer algorithm.
- Find mid point of given list.
- Check if number at mid is equal to key. If equal then return mid.
- If not equal then it will search for key in one half of the list based on these condition -
- If number at mid of list is greater than key then search in first half of the list.
- If number at mid of list is smaller than key then search in second half of the list.