3 ms·
The sort in the OP isn't Exchange Sort, though. In exchange sort the inner loop runs from i+1 to N, not from 0 to N, and the swap order is transposed.
by jp57 2y ago
The sort in the OP isn't Exchange Sort, though. In exchange sort the inner loop runs from i+1 to N, not from 0 to N, and the swap order is transposed.
- teach 2y agoThen I guess I called it exchange sort incorrectly. I'm certain this is the code I taught them -- both loops went from 0 to (less than) N.