a) Give a recursive algorithm for finding the max of a finite set of integers, making use of the fact that the max of n integers is the larger of the last integer in the list and the max of the first n-1 integers in the list.
Procedure power(x,n):
If (n=0):
return 1
Else:
return power(x,n-1) · x
b) Use induction to prove your algorithm is correct
Get Answers For Free
Most questions answered within 1 hours.