Originally Posted by MacNilly ...The obvious choice here is when there are no more values in the array to compare.... Then, for the base case, inside the function: Code: if (size == 1) return MAX(cur_max, array[0]); Err, I think you mean the obvious choice is when there is one element in the array: Code: if ( size == 1 ) return array[0]; since that value *has* to be the max.
if (size == 1) return MAX(cur_max, array[0]);
if ( size == 1 ) return array[0];
Im getting the idea, but how do u split an array in half? Code: like array[]={1,2,3,4} to array[]={1.2} and array[]={3,4] ?
like array[]={1,2,3,4} to array[]={1.2} and array[]={3,4] ?