2 ms·
Oh, based on your other comment, I finally understood what you meant initially. You were saying that the final array doesn't have many indices i,j such that a[
by XCSme 4y ago
Oh, based on your other comment, I finally understood what you meant initially.
You were saying that the final array doesn't have many indices i,j such that a[i] = sorted_a[j] and a[j] = sorted_a[i].
My initial comment was not referring to the final order of the array, but the operations made to reach that order (one or multiple swaps). Another example could have been saying that we could have named the "sort" method "compare" because it uses comparisons in its algorithm (which was a parallel to your initial comment that it's called "swap" because the reverse operation uses swaps to achieve this).