Re:Is this the simplest (and most surprising) sorting algori...
by jtolmar on Tuesday October 05, 2021 @07:33PM
(#28767111)
You can turn a sort into a shuffle by replacing the comparator with a random coin flip, and you already have defined a sort algorithm, so there's no added code complexity.
[ Parent
| on HN ]
Re:Is this the simplest (and most surprising) sorting algori...
by aidenn0 on Tuesday October 05, 2021 @08:05PM
(#28767400)
You can't turn all sorts (not even all comparison sorts!) into a shuffle by replacing the comparator with a random coin flip. In fact your code post is a demonstration of that fact.