This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int findLargest(int array[]) | |
{ | |
int arrayLength = sizeof(array)/sizeof(array[0]); | |
int firstElement = array[0]; | |
int newArray[] = // This needs to be a new array without the original array's first element. | |
if (arrayLength == 1) { | |
return max(firstElement, newArray[0]) | |
} else { | |
return max(firstElement, findLargest(newArray)); | |
} |