********* BINARY SEARCH *********
In computer science, binary search, also known as half-interval search,logarithmic search, or binary chop,is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array. Even though the idea is simple, implementing binary search correctly requires attention to some subtleties about its exit conditions and midpoint calculation.
Worst-case performance : O(log n)
Best-case performance : O(1)
Average performance : O(log n)
On this page of the site you can watch the video online Implementing the Binary Search in Python - using Python Lists with a duration of hours minute second in good quality, which was uploaded by the user CODE OF GEEKS 08 January 2019, share the link with friends and acquaintances, this video has already been watched 745 times on youtube and it was liked by 21 viewers. Enjoy your viewing!