Write a program recursive_binary_searcher.py that:
key = 13
, for example)arr
for the list of numbers, value
for the search term, lower
for the lower bound of the search space, and upper
for the upper bound of the search space.-1
if it is not found.main()
program should out the location of the search item, if it exists. Otherwise, print out a "search item not found" message.recursive_binary_searcher.py
with the same lists and values.Example Output:
List to search Item to look for Expected result
[1, 2, 3, 4, 7, 9, 13, 14, 20] 7 4
[1, 2, 3, 4, 7, 9, 13, 14, 20] 1 0
[1, 2, 3, 4, 7, 9, 13, 14, 20] 20 8
[1, 2, 3, 4, 7, 9, 13, 14, 20] -2 -1
[1, 2, 3, 4, 7, 9, 13, 14, 20] 23 -1
[1, 2, 3, 4, 7, 9, 13, 14, 20] 10 -1
[4, 7, 9, 13, 14, 20] 9 2
[4, 7, 9, 13, 14, 20] 13 3
[4, 7, 9, 13, 14, 20] 20 5
[4, 7, 9, 13, 14, 20] 2 -1
[4, 7, 9, 13, 14, 20] 10 -1
[4, 7, 9, 13, 14, 20] 22 -1