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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!