In the first pass, the first two numbers are compared. The shuttle sort compares the numbers in pairs from left to right exchanging when necessary. An additional number is involved in each pass. The 9 is the larger and so the 9 and the 6 are exchanged. 1 st pass Shuttle Sort Example 96 Comparisons:Swaps:11
In the second pass, the first three numbers are involved. The second and third numbers are compared, and swapped if necessary. Then the first and second numbers are compared, and swapped if necessary. Shuttle Sort Example st pass Comparisons:Swaps: nd pass
In the third pass, the third and fourth numbers are compared, and swapped if necessary. No swap is needed in this case, so the third pass ends here. 3 rd pass Shuttle Sort Example st pass nd pass Comparisons:Swaps:334
The passes continue in the same way. The fourth pass ends here as no swap is needed. Shuttle Sort Example 3 rd pass st pass nd pass th pass Comparisons:Swaps:
The fifth pass ends here as no swap is needed. Shuttle Sort Example 3 rd pass st pass nd pass th pass Comparisons:Swaps:64 5 th pass
Shuttle Sort Example 3 rd pass st pass nd pass th pass th pass th pass Comparisons:Swaps:
The list is now sorted. Shuttle Sort Example 3 rd pass st pass nd pass th pass th pass th pass th pass Comparisons:Swaps: