4 ms·
Hmm, come to think about it, it does have a lot going for it as an illustrative algorithm! - It’s really simple - It’s a bit counterintuitive, so makes a cute
by iainmerrick 5y ago
Hmm, come to think about it, it does have a lot going for it as an illustrative algorithm!
- It’s really simple
- It’s a bit counterintuitive, so makes a cute puzzle
- It’s a good exercise for a first correctness proof
- And it’s obviously a pretty pessimal algorithm, so students shouldn’t be tempted to use it in real code (hopefully...) Compared to bubble sort, which seems somewhat plausible, so people end up actually using it for real even though it’s a terrible algorithm.