|
|
|
|
|
by klyrs
2521 days ago
|
|
The article describes these algorithms "efficient" on the basis of being linear, and they're not. Insertion and selection require O(n^2) moves or compares respectively (or, n log(n) with use of data structures). As it stands, the page is pretty as heck but teaching a misconception. |
|
If memory writes are expensive (relative to reads and comparisons), selection sort is much better than insertion and bubble sort. Which is not something I had considered before trying to defend the post from the original comment.
> Insertion and selection require O(n^2) moves or compares respectively (or, n log(n) with use of data structures). As it stands, the page is pretty as heck but teaching a misconception.
I am definitely aware of the runtime of the sorting algorithms discussed. I have written about all of them [0]. Originally, I was going to agree and write about how it was a concerning misconception, but at least in the case of selection sort there is some (albeit small) merit to considering selection sort as O(n).
Though given that I cannot come up with a defense for insertion sort it is likely the author doesn't understand the time complexity of the sorting algorithms presented.
[0]: http://thethirdone.github.io/blog/posts/random-sorting/