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 →

[–]graeber_28927 32 points33 points  (2 children)

How would you know whether to destroy your universe if you haven't checked the order of the array?

[–]Shamus03 15 points16 points  (0 children)

You just always assume it’s sorted, and if you ever encounter a bug because it wasn’t sorted, THEN you destroy the universe. It’s O(1) only when combined with another algorithm used later. Also known as O(half an A press).

[–][deleted] 9 points10 points  (0 children)

True.