Keep Bogo Sort vs Bogo Sort
Same 110 values, same shuffle, same speed. Keep Bogo Sort finishes first and turns gold.
The numbers
- Keep Bogo operations
- 12,973
- Bogo operations
- never finishes
- Keep Bogo average
- n²
- Bogo average
- n·n!
- Keep Bogo worst
- ∞
- Bogo worst
- ∞
Keep Bogo Sort
Keep Bogo Sort shuffles at random, but every element that lands in the right spot stays there. More on Keep Bogo Sort.
Bogo Sort
Bogo Sort shuffles the list at random and checks if it's sorted. Then it shuffles again. More on Bogo Sort.
FAQ
Which is faster, Keep Bogo Sort or Bogo Sort?
Keep Bogo Sort. Bogo Sort shuffles at random and, for a list this long, never finishes.
Which one is stable?
Neither is stable.
How is the race fair?
Both algorithms start from the same shuffle and run the same number of operations per frame. Every comparison, swap and write counts as one operation, so the one that needs fewer operations finishes first.