Question: 7. Given the following divide and conquer algorithm, and the array a = { 1, 4, 6, 2}. Draw the recursive tree and determine the
7. Given the following divide and conquer algorithm, and the array a = { 1, 4, 6, 2}. Draw the recursive tree and determine the number of recursive calls required to find the maximum value. int max(int all, int i, int r) if(1 =- r) return a [1]; int m = (1+r)/2; int u= max(a,l,m); int v = max(a,m+1,r); if ( u > v) return u; else return v
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
