public class SelectionSort {

	public static void sort(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			int min = i;
			for (int j = i + 1; j < arr.length; j++) {
				/* find local min */
				if (arr[j] < arr[min]) {
					min = j;
				}
			}
			swap(arr, i, min);
		}
	}

	private static void swap(int[] arr, int i, int j) {
		int temp = arr[i];
		arr[i] = arr[j];
		arr[j] = temp;
	}
}

@@ -1,33 +1,546 @@
-public class SelectionSort %7B%0A
+/**%0A * Utility class for sorting an array using Selection Sort algorithm. Selection%0A * Sort is a basic algorithm for sorting with O(n%5E2) time complexity. Basic idea%0A * of this algorithm is to find a local minimum, which is the minimum value from%0A * (i+1) to length of the array %5Bi+1, arr.length), and swap it with the current%0A * working index (i).%0A *%0A * @author Kongpon Charanwattanakit%0A *%0A */%0Apublic class SelectionSort %7B%0A%0A%09/**%0A%09 * Sort an array using Selection Sort algorithm.%0A%09 *%0A%09 * @param arr%0A%09 *            is an array to be sorted%0A%09 */
 %0A%09pu
@@ -786,16 +786,249 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09/**%0A%09 * Utility method for swapping elements in an array.%0A%09 *%0A%09 * @param arr%0A%09 *            is an array to be swapped%0A%09 * @param i%0A%09 *            is index of first element%0A%09 * @param j%0A%09 *            is index of second element%0A%09 */%0A
 %09private

Add javadoc