There are 6 students standing in a queue, in some order. They want to arrange themselves according to their height, following the algorithm below:
What is the maximum number of rounds it could take for them to sort themselves?
For example, if they were initially arranged in the reverse order (654321), it would take 6 rounds of these swaps for the students to sort themselves to the desired arrangement (123456), as shown in the animation:
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.
No explanations have been posted yet. Check back later!