192k views
0 votes
Given the list (7, 23, 12, 8, 5, 6), what is the order of the elements after the third insertion sort swap?

User Chrystine
by
9.2k points

1 Answer

2 votes
So the order of the elements after the third swap is (7, 8, 12, 23, 5, 6). Note that the 5 and 6 have not yet been sorted, since they have not yet been examined by the algorithm
User Elben Shira
by
8.5k points