A binary search is an algorithm to find a particular element in the list. Compare x with the middle element if the element is equal to x, we return the mid index. Compare x with the middle element if the element is greater than x, then x can only lie in left half of the array, eliminate the right half of array and we apply the same algorithm for left half. Compare x with the middle elemnet if the element is less than x, then x can only lie in right half of the array, eliminate the left half of array and we apply the same algorithm for right half.
UtkarshBhardwaj123/Binary-Search-Algorithm
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|