Needs["CSM`SortAux`"]

SelectionSort::usage = "SelectionSort[l] sorts the list l."

SelectionSort[list_List] :=
	Module[{l = list, i, n = Length[list], min, minj, j},
		Do[
			min = l[[i]]; minj = i;
			Do[ If[l[[j]] < min, min = l[[j]]; minj = j], {j, i+1, n} ];
			swap[l, i, minj],
		   {i, 1, n-1}];
		l
	]
