Question: 1 import java.util.Arrays; 2 ? public class Labs{ //part a) // base case 1 return a[e]; 4 public static int maximum(intl] a)t if(a.length ## 1)

 1 import java.util.Arrays; 2 ? public class Labs{ //part a) //

base case 1 return a[e]; 4 public static int maximum(intl] a)t if(a.length

1 import java.util.Arrays; 2 ? public class Labs{ //part a) // base case 1 return a[e]; 4 public static int maximum(intl] a)t if(a.length ## 1) // base case 2 9 if (a.length2) if(a[a.length-1]a[a.length-2]) return ala.length-2]; return a[a.length-1]; // comparing the last 2 and putting the greater number in last but one in the array a[a.length-2]a[a.length-1]; return maximum(Arrays.copyOfRange(a, , a.length-1)); // part b) int resulta[ej; else 6' ?f(a[a.length-1] > a[a.length-2]){ 2 public static int minimum (int[] a)f 4 for (int i-1; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!