this post was submitted on 01 Sep 2026
92 points (100.0% liked)
Programmer Humor
33288 readers
654 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
- If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It really does look more broken the more I look. I began to think that it would sort odd and even lists in opposite orders, since half the time it's comparing pairs the opposite way around.
not sure why you see different behaviour based on parity, but it does sort in descending order. that is why the inequality operator in
if A[i] < A[j] then swapis reversed.