Ask Question
20 October, 03:32

Give a recursive algorithm which takes as input a sequence of numbers and returns the minimum (i. e., smallest) number in the sequence. Your algorithm should not use a loop.

+5
Answers (1)
  1. 20 October, 04:10
    0
    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)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Give a recursive algorithm which takes as input a sequence of numbers and returns the minimum (i. e., smallest) number in the sequence. ...” in 📘 Mathematics if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers