(in c programming)
I have another index question if you don’t mind.
I use this function to find the highest number in an array of integers:
int Find_max(int *array,int n){
if(n==1) return array[0];
int num1=Find_max(array,n/2);
int num2=Find_max(array+n/2,n-n/2);
if(num1>num2) return num1;
return num2;
}
how do I get the index of the number I found? I’m not allowed to use any kind of loops.
Almost the same code (style retained):