4 ms·
Intuitive? Bubble sort is the most counterintuitive sort I know after Shell sort. I still have to think hard about what it does every time I read it and I'm not
by throwaway613834 9y ago
Intuitive? Bubble sort is the most counterintuitive sort I know after Shell sort. I still have to think hard about what it does every time I read it and I'm not sure if I remember it accurately to be honest.
So I don't understand how people find it intuitive. Insertion sort is far, far more natural.
- deleted 9y ago[deleted]
- edflsafoiewq 9y agoIt's not even particularly clear that bubble sort halts. Unlike insertion sort, the loop variant is not trivial to write down. I suppose the best thing about it is that it is very clear that if it halts, the array is sorted.