Question: Consider the following C++ code, and answer the following questions. 1. What gets output when you call funcA([1,2,3,4,5], 5) ? More importantly, why does
Consider the following C++ code, and answer the following questions. 1. What gets output when you call funcA([1,2,3,4,5], 5) ? More importantly, why does this get output? All of the points for this problem will be assigned based on your explanation (since we have no doubt that you can run this program for a fixed input and copy down the output). We strongly recommend solving this by hand/calculator, and only using a compiler to verify your answer. void funcA (int *a, int size) { funcB(a, 0, size-1); } 2. For what input values would funcB fail to terminate? Why will funcB always terminate for other input values? 3. What gets output when you call funcB(a, min, max) and why? void funcB(int *a, int min, int max) { if (min max) } cout < < a[min] < < endl; else { } int mid (min-max)/2; funcB(a, min, mid); funcB(a, mid+1, max);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
