/* return the smallest of the elements in array x[] * there are n elements in x[
ID: 3610736 • Letter: #
Question
/* return the smallest of the elements in array x[]* there are n elements in x[] (x[0].. x[n-1]) * solve the problem recursively and * use an "n-1" type of decomposition */
int minRec1(int x[], intn){ } x[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] n =10 its recursion so no loopsand use a basecase, but of course you guys knowthat. any help would beappreciated /* return the smallest of the elements in array x[]
* there are n elements in x[] (x[0].. x[n-1]) * solve the problem recursively and * use an "n-1" type of decomposition */
int minRec1(int x[], intn){ } x[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] n =10 n =10 its recursion so no loopsand use a basecase, but of course you guys knowthat. any help would beappreciated any help would beappreciated
Explanation / Answer
#include int minRec1(int* x, int n){ int min; if(n==1) return x[n-1]; min = minRec1(x, n-1); if (x[n -1]Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.