+ 1

I want code to find the second largest number in unsorted array

The array is unsorted and I want to find largest number and then second largest number

12th Feb 2017, 11:46 AM
Mohit Patil
Mohit Patil - avatar
1 Odpowiedź
+ 3
There are many ways to do that. One such way is: 1) Define a temporary array and fill it with your array's elements. 2) Sort the temporary array in descending order and print the second element.
12th Feb 2017, 4:54 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar