algorithms.tutorialhorizon.com

Find first three largest elements in a given array | Algorithms

Objective: Given an array of integers, write an algorithm to find the first three largest elements in the array. Example: Int [] a = { 6, 8, 1, 9, 2, 1, 10}; Output: 10, 9, 8 Int [] a = { 6, 8, 1, 9, 2, 1, 10, 10}; Output: 10, 10, 9 Int [] a = {6}; Output: Invalid Input, array size is less than 3