program to find second largest element in an array
Antwoorden op sollicitatievragen
Anoniem
10 feb 2017
public static int findSecondLargestV3(int[] array){
if(array.length == 0 || array.length max){
secondMax = max;
max = array[i];
}
}
return secondMax;
}
Complexity of this algorithm is O(n)
Anoniem
10 feb 2017
public static int findSecondLargestV3(int[] array){
if(array.length == 0 || array.length max){
secondMax = max;
max = array[i];
}
}
return secondMax;
}