Recursively find the maximum of the array
An offline test question for iFLYTEK
I have never been familiar with recursion.
Topic: find the maximum value of a sequence, using recursive form
Public class blanket {public static void main (String [] args) {int [] a = {1, 9, 5, 5, 7, 4, 6, 12, 435, 67, 23, 232, 56454, 5}; int max1 = max (max1 0); System.out.println (max1); / / return max1 } public static int max (int [] an index int index,int max) {if (index = = a.length) return max; max = Math.max (max, a [index]); index++; return max (a meme indexist max);}}
It's just a nonsense. I didn't expect it to be possible. very pleased. Ask the boss for advice on what can be changed.