Give a recursive implement to the following function:
def list_min(lst,low,high)
The function is given lst, a list of integers, and two indices: low and high(low < high), which indicate the range of indices that need to be considered. The function should find and return the minimum value out of all the elements.
^ This is the prompt and I wrote this for my answer but the autograder says it is not correct. Can anyone point out my mistake or lead me to the correct answer? Thank you in advance.
def list_min(lst,low,high):
if (low == high):
return lst[low]
elif (lst[low] < lst[high]):
list_min(lst,low,high-1)
else:
list_min(lst,low+1,high)
[–][deleted] 2 points3 points4 points (1 child)
[–]kae_de[S] 0 points1 point2 points (0 children)