n// This function will sort a given array in
ascending order
n// and it will also return how many exchanges
needed in the process
nint SelectionSort(int list[], int size) {
n int move =
0;
n int smallIndex;
n for(int
i = 0; i < size; i++) {
n smallIndex =
smallestElement(list, size, i);
n if (
smallIndex != i) {
n move++;
n swap(list[i],
list[smallIndex]);
n }
n }
n return
move;
n}
n