Question: Implement the following global function using a recursive algorithm to find and return the location of the smallest value in an array of integers. const
Implement the following global function using a recursive algorithm to find and return the location of the smallest value in an array of integers. const int * min(const int arr[], int arrSize); You may not use a loop of any kind. You may not use global or static variables.
#include
using namespace std;
#include "minFunc.h"
int main() { int arrSize; cin >> arrSize; int arr[arrSize]; for (int i = 0; i < arrSize; ++i) { cin >> arr[i]; } const int *minLoc = min(arr, arrSize); cout << *minLoc << endl; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
