cout << " Vector afterhand: \t";
for (int i = 0; i < unsorted.size(); i = i + 1)
{ cout << unsorted[i] << " ";
}
cout << "\n";
}
return 0;
}
I'm trying to put our algorithm between the ////'s. We're only allowed to use for loops also. What I currently have is the minimum number finder and the use of temp to find the values. However, it doesn't seem to be working. I don't want you to do the program for me, but I'd appreciate it if someone can walk through some of the steps as to what I should do. And maybe look through what I have and see if there are any errors in there. Thanks :)
Other variant is to select minimum element and swap it with the first, then select minimum of the remaining elements and swap it with the second etc. The procedure of choosing minimum you can practice here: