Write a program in java to display the 2nd largest element in an array without sorting the array.
Answers
Answered by
1
Answer:
sorry I didn't get it...
Answered by
1
Explanation:
Java Program to find Second Largest Number in an Array
public class SecondLargestInArrayExample{
public static int getSecondLargest(int[] a, int total){
int temp;
for (int i = 0; i < total; i++)
{
for (int j = i + 1; j < total; j++)
{
if (a[i] > a[j])
Similar questions