Let's begin!
Binary Search is a Searching Algorithm with logarithmic time complexity.
It need the list to be sorted, form the sorted list it goes to the element at the middle.
If the middle element is equal to target it returns true.
Else if the target element is less than the middle range then it changes it's range from low to middle and call the function with new parameters.
Else if the target element is greater than the middle range then it changes it's range from middle to high and call the function with new parameters.
Else returns false.
Comments
Post a Comment