Frage im Vorstellungsgespräch bei Cordis

Print the second largest element in array?

Antworten zu Vorstellungsgespräch

Anonym

26. Okt. 2020

use by sorting or naive approach.

Anonym

5. Jan. 2022

First we take an arr[] elements Ex: arr[]={1,2,31,51,5,6}; Than take a two variables for comparison Use foreach function Apply the if(x>large) { Second=firstlarge firstlarge=x } if(firstlarge==second ||( x>second && x