It compares the two elements, and then either swaps them (if the element with the smaller index number is larger than the other element) or leaves them alone (if the element with the smaller index is smaller than the other element). In either case, after such a step, the larger of the two elements will be in the higher index position. | ![]() ![]() |