Given an array, A of integers, return the second largest even element.
Answers
Answered by
0
Answer:
Explanation:
Let's see another example to get second largest number in java array using collections.
import java.util.*;
public class SecondLargestInArrayExample2{
public static int getSecondLargest(Integer[] a, int total){
List<Integer> list=Arrays.asList(a);
Collections.sort(list);
int element=list.get(total-2);
return element;
}
More items...
Similar questions