figure binary search of an ordered list of integers list in sequencea binary search will start by examining the middle item if that item is the one we are searching forwe are done if it is not the correct itemwe can use the ordered nature of the list to eliminate half of the remaining items if the item we are searching for is greater than the middle itemwe know that the entire lower half of the list as well as the middle item can be eliminated from further consideration the itemif it is in the listmust be in the upper half we can then repeat the process with the upper half start at the middle item and compare it against what we are looking for againwe either find it or split the list in halftherefore eliminating another large part of our possible search space figure shows how this algorithm can quickly find the value def binary_search(a_listitem)first last len(a_list found false while first <last and not foundmidpoint (first last/ if a_list[midpoint=itemfound true elseif item a_list[midpoint]last midpoint elsefirst midpoint return found test_list [ ,print(binary_search(test_list )print(binary_search(test_list )before we move on to the analysiswe should note that this algorithm is great example of divide and conquer strategy divide and conquer means that we divide the problem into smaller piecessolve the smaller pieces in some wayand then reassemble the whole problem to get the result when we perform binary search of listwe first check the middle item if the item we are searching for is less than the middle itemwe can simply perform binary search of the left half of the original list likewiseif the item is greaterwe can perform binary search of the right half either waythis is recursive call to the binary search function passing smaller list searching