Give a recursive algorithm which takes as input a sequence of numbers and returns the minimum (i.e., smallest) number in the seq
uence. Your algorithm should not use a loop.
1 answer:
Answer:
Step-by-step explanation:
So let a[i] be the input array to the function find_minimum(): . We will use python to present this recursive algorithm
def find_minimum(a, n):
if n == 1:
return a[0]
return min(a[n], find_minimum(a, n - 1))
find_minimum(a, len(a) - 1)
You might be interested in
See photos for solutions and steps :)
Ahh that’s very very very very swag
X is less then or equal to 1<u /><em /><u />
Answer:
c.
............
..............................