Question: Write a C++ program called max_index.cpp that reads n integer numbers from a user and returns the index of the biggest number in the input
Write a C++ program called max_index.cpp that reads n integer numbers from a user and returns the index of the biggest number in the input numbers using a divide-and-conquer algorithm. For the problem, you can assume that a user will not enter more than 100 integer numbers. In other words, the input size will be less than 100.
To get the basic idea of C++ implementation of a divide-and-conquer algorithm, read the item entitled Divide and conquer for array sum: C++ code at News forum on the iLearn. You can find the News forum link at the very top of the iLearn.
Note that if you do not use a divide-and-conquer algorithm, you will get no credit for the problem.
The following presents a sample run of the program. Your program has to run exactly like this:
Input size: 5
Enter 5 integers: 2 7 3 9 4
Index: 3
This is another sample run:
Input size: 8
Enter 8 integers: 2 10 75 1 3 9 4 100
Index: 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
