What is this odd sorting algorithm?
Some answer originally had this sorting algorithm: for i from 0 to n-1: for j from 0 to n-1: if A[j] > A[i]: swap A[i] and A[j] Note that both i and j go the full range and thus j can be both larger and smaller than i , so it can make pairs both correct and wrong order (and it actually does do both!). I thought that's a mistake (and the author later calle