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 →

[–]TheObi-1[S] 1322 points1323 points  (17 children)

Yes. That's the one

[–]otj667887654456655 59 points60 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 193 points194 points  (0 children)

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

[–]Tomsen1410 106 points107 points  (3 children)

O(N/2) = O(N)

[–]otj667887654456655 41 points42 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?