News for hackers. Stuff that matters.
Re:Is this the simplest (and most surprising) sorting algori... by copypasterepeat on Monday February 24, 2025 @01:39PM (#43163144)
I agree. At first I thought it was doing something very simple but I am not so sure anymore. When you check the condition for the swap, you realize it almost works counterproductively while i<j because it keeps pushing smaller numbers in the wrong direction, but then it starts "fixing" those mistakes when i>j. I don't find this intuitive at all.

There are no comments on this comment yet.