Given the function prototype for a function called secondLargest given a pointer to a list of integers, write down on a piece of paper how you would implement this function and read it back to me. Follow up questions included what is the complexity of your algorithm (O notation)? How would you extend it to do nthLargest element?
Anonimo
linear solution if you track highest and secondHighest with integer variables