News for hackers. Stuff that matters.
Re:Visualizing and exploring sorting algorithms in two dimen... by klyrs on Saturday July 27, 2019 @12:49AM (#20540434)
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.
Re:Visualizing and exploring sorting algorithms in two dimen... by thethirdone on Saturday July 27, 2019 @01:02AM (#20540476)
> The article describes these algorithms "efficient" on the basis of being linear, and they're not.

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/

Re:Visualizing and exploring sorting algorithms in two dimen... by devin on Saturday July 27, 2019 @01:12AM (#20540509)
Great article. Thanks for posting.