Yes, bubblesort is never used in serious applications. It is now mainly used for educational purposes.
Edit:
Another thing about your code (if you choose to keep it). You can shave off some lines of code by using struct assignment.
Review temp;
temp = vector.at(k);
vector[k] = vector.at(k-1);
vector[k-1] = temp;
Review temp;
temp = vector.at(k);
vector[k] = vector.at(k-1);
vector[k-1] = temp;
To copy to clipboard, switch view to plain text mode
And, well, you can also just use the standard C++ swap() or the Qt qSwap() function. (They're identical. One wonders why Qt has its own version.)
qSwap(vector[k], vector[k-1]);
qSwap(vector[k], vector[k-1]);
To copy to clipboard, switch view to plain text mode
Bookmarks