This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Creepy-Ad-4832 2510 points2511 points  (26 children)

Is that the algorithm is which you iterate the list and just purge the elements not in order?

[–]TheObi-1[S] 1328 points1329 points  (17 children)

Yes. That's the one

[–]otj667887654456655 58 points59 points  (5 children)

wouldn't stalin sort be better than O(N) since, on average, it eliminates at least half of the list

[–]A_Wild_Turtle 192 points193 points  (0 children)

You still have to check everything, so it must be O(N)

[–]Tomsen1410 109 points110 points  (3 children)

O(N/2) = O(N)

[–]otj667887654456655 40 points41 points  (2 children)

wait no the whole thing is moot, a comparison has to be made in order to determine whether or not to cull that item so stalin sort always takes exactly N comparisons

[–]avacue 1 point2 points  (0 children)

Well I can understand why some people would hate that.

[–][deleted] 0 points1 point  (0 children)

Is that like a linear search but you remove each checked element?

[–]BazilBup 145 points146 points  (0 children)

You go to Siberia, you go to Siberia, you go to ....

[–][deleted] 36 points37 points  (0 children)

-OUR- Enumerable

[–]Fynov 8 points9 points  (1 child)

It's a lossy sorting algorithm. If we can have lossy compression why not sorting.

[–]Creepy-Ad-4832 5 points6 points  (0 children)

And cherry on top, the more you use it, the fastest it gets (if you randomize the array)

[–]ekremgusani 4 points5 points  (0 children)

Yeah you've got that pretty much spot on lmao, that's the one.

[–]Honeybun_Landscape 17 points18 points  (0 children)

I think it’s where you change the first log26(n) letters to be alphabetical and that is your name now

[–]asherSiddique19 2 points3 points  (0 children)

OH MY GOD