1. Other
  2. Other
  3. this is for discrete math...

Question: this is for discrete math...

Question details

Exercise 8.10.3: Recursively computing the maximum and minimum of a sequence. About The input to the maximum and minimum problems is a sequence of numbers, a 1.. an, where n, the length of the sequence, is a positive integer. The function length(a 1... n) returns n, the length of the sequence. If n>1, you can also create a new sequence a.an which is the original sequence a . an, with the last number an omitted a) Give a recursive algorithm which takes as input a sequence of numbers and returns the minimum (.e, smallest) number in the sequence. Your algorithm should not use a loop. (b) Give a recursive algorithm which takes as input a sequence of numbers and returns the maximum (i.e., largest) number in the sequence. Your algorithm should not use a loop. Feedback?This is for discrete math

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution