In every iteration the smallest (or greatest) element move upwards like a bubble.
for (int i = 0; i < array.count()-1; ++i) {
for (int j = array.count()-1; j > i; --j) {
if (array[j] < array[j-1]) {
array.swap( j-1, j );
}
}
}
⇒
⇒