Thursday, October 25, 2012

Java Exercise #33: Selection Sort

Selection sort finds the largest number in the list and places it last. It then finds the largest number from the remaining list and places it second last and so on.

Exercise: Write an implementation for Selection Sort.


Before sort: 
List is : [69, 4, 2, 10, 60, 50, 59, 11, 7, 70, 66, 79, 45 ]
After sort: 
List is : [2, 4, 7, 10, 11, 45, 50, 59, 60, 66, 69, 70, 79 ]



Download Code: Selection Sort

No comments:

Post a Comment