6 students with different heights are standing in a row, being the shortest and the tallest: They want to rearrange themselves by height, with the tallest on the far right: 123456.
The teacher proposes the following algorithm:
Counting each phase as one round, how many rounds does it take to sort the given row of students?
For example, if they were initially arranged in reverse order (654321), it would take 6 rounds of these swaps for the students to sort themselves, as shown below:
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
R e d numbers have swapped positions in the current phase.
4 rounds = 1 2 3 4 5 6