Python Binary Search Algorithm in 6 Minutes

preview_player
Показать описание
Binary Search is a 'Divide and Conquer' algorithm which requires the initial array to be sorted before searching.
It is called binary because it splits the array into two parts and searches the item in the middle of the array: if the item is equal to the element at the mid index array position, the item is found. If the item is not at mid point but it is smaller (bigger) than the elment at the mid point, the rigth (left) index is moved at mid minus (plus) one position and the algo keeps on searching UNTIL the item is at mid point poisiton or left index is equal to rigth index and the item is not found then !
Рекомендации по теме
visit shbcf.ru