Question: a) Write a recursive function rec_max (arr, n) to find the maximum of a given vector arr (of length n). Don't use the Matlab
a) Write a recursive function rec_max (arr, n) to find the maximum of a given vector arr (of length n). Don't use the Matlab function max. b) Write a recursive function rec_min (arr, n) to find the minimum of a given vector arr (of length n). Don't use the Matlab function min. c) Can you also write both functions without the need to pass the length argument (i.e. in the form rec_max (arr), rec_min (arr))?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
