Computer Science, asked by Rwarmachine019, 7 months ago

Write a program in java to display the 2nd largest element in an array without sorting the array.

Answers

Answered by ATHARVADERE77
1

Answer:

sorry I didn't get it...

Answered by Anonymous
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