Write a java program to find second smallest element in an array.
Answers
Answered by
0
// A method to get the second smallest element in the passed int Array.
static int secondSmallest(int[ ] array) {
int[ ] temp = array;
java.util.Arrays.sort(temp);
return temp[1];
}
Similar questions