function out=selectionSort(a)
for j = 1:length(a)
    min = j;
    for i = j+1:length(a)
        if a(i) < a(min)
            min = i;
        end;
    end;
    temp = a(j); a(j) = a(min); a(min)=temp;
end;
out = a;