How to Find Second Largest Element in an Unsorted Array

Write a Program to find second largest element in an unsorted array. You can solve this problem by using sorting algorithm or you can do without sorting in single traversal O(n) time complexity.

Sorting algorithm such as Selection Sort, Insertion Sort, Bubble Sort is not suitable for large data elements as their time complexity is O(n2) . For sorting you can use Merge Sort or Quick Sort.