Question: # Write a recursive function ` search ` that # takes an ordered array of numbers as a parameter # and a number to search

# Write a recursive function `search` that
# takes an ordered array of numbers as a parameter
# and a number to search for and returns the index
# of the number in the array using binary, or -1 otherwise. For
# full credit, the search should be implemented using
# recursion, rather than a loop......
# what can we use to determine if the index number you get back is the first one of that type in the list
def binary_search(array, num):
return search(array, num, 0, len(array)-1)
def search(array, num, min, max):
# FIXME
#mid =(max+min)//2
if min > max:
return -1
else:
mid=(min+max)//2
if num

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!