|
|
|
|
|
by OJFord
1453 days ago
|
|
Why is this algorithm at all surprising? (I'm really not trying to brag - I assume I must be missing something, that I'm naïve to think it obviously works, and it actually works for a different reason.) In plain English - 'for every element, compare to every element, and swap position if necessary' - .. of course that works? It's as brute force as you can get? |
|
The surprising algorithm sorts even though it swaps elements that are already ordered.