Theory
In Binary search the elements must be sorted order and are searched by breaking it into two parts searching in the
upper part or lower part based on the mid value and the process continues till key found / not found.
Program Code
Input
Enter Array values0 1 2 3 4 5 6 7 8 9
Given Array is:
0 1 2 3 4 5 6 7 8 9
Enter Search Key
5