How to find Top Ten largest numbers from an int Array of 100 elements

Nov 3 2008 11:22 PM

I am a newbie and would like to write a method which will take int array of 100 elements(unsorted array) I dont want to use any sort algorithm , I would like to compare the numbers and print the top ten numbers.

The signature would look like this :

public int[] FindTopTen(int[] intarray)

{}

 

I could only write this for top two numbers.

 

Any help is highly appreciated.

 

Regards

Sangeetha

 


Answers (6)