Answer:It is a well-known sorting method. It differs from the selection sort in that, instead of finding the smallest record and then performing an interchange, two records are interchanged immediately upon discovering that they are out of order. In this method, after the first pass, the record with the largest key will be in the nth position. On each successive pass, the records with the next largest key will be placed in position n-1, n-2,…respectively.
Pass:
Initially the elements of the array are:
9 8 7 6 5 4 3 10 2 1
9 8 7 6 5 4 3 3 2 1
8 7 6 5 4 3 4 2 1 2
7 6 5 4 3 5 2 1 3 3
6 5 4 3 6 2 1 4 4 4
5 4 3 7 2 1 5 5 5 5
4 3 8 2 1 6 6 6 6 6
3 9 2 1 7 7 7 7 7 7
10 2 1 8 8 8 8 9 8 8
2 1 9 9 9 9 9 8 9 9
1 10 10 10 10 10 10 10 10 10