Heres how it is do it....
Example array. I want the top 3 numbers in this array of numbers.
Iteration 1
[0,1,7,5,2,8,3,9,4,(6)] Take the six and move it right until you reach a number higher than itself.
[0,1,7,5,2,8,3,(9),6,4] Now take the next number (the larger one which stopped it) and repeat.
[(9),0,1,7,5,2,8,3,6,4]
Iteration 2
[9,0,1,7,5,2,8,3,6,(4)] Take the four and move it right until you reach a number higher than itself.
[9,0,1,7,5,2,8,3,(6),4] Now take the six and move it right until you reach a number higher than itself.
[9,0,1,7,5,2,(8),6,3,4] Now take the eight and move it right until you reach a number higher than itself.
[9,(8),0,1,7,5,2,6,3,4]
Iteration 3
[9,8,0,1,7,5,2,6,3,(4)] Take the four and move it right until you reach a number higher than itself.
[9,8,0,1,7,5,2,(6),4,3] Take the six and move it right until you reach a number higher than itself.
[9,8,0,1,(7),6,5,2,4,3] Take the seven and move it right until you reach a number higher than itself.
[9,8,7,1,6,5,2,4,3]
I now have the 3 greatest numbers without sorting the entire list. I only sorted X which is the numerb of greatest elements i wanted.