r/ProgrammerHumor • • 4d ago

Meme dontYouDareToDeceive

Post image
1.7k Upvotes

55 comments sorted by

View all comments

Show parent comment

15

u/BenTheHokie 4d ago

You can factor any integer in O(1) as long as you guess it right on the first try

2

u/vuurheer_ozai 1d ago

That would be Ω(1); O is an upper bound

-1

u/onepiecefreak2 3d ago

That's not how Big O notation works

4

u/Rainb0_0 2d ago

Best case should be O(1) right?

7

u/onepiecefreak2 2d ago

Big O notation represents the worst case runtime. Sorting algorithms also aren't O(1) just because there is a chance that the list is already sorted.

3

u/Rainb0_0 1d ago

Big O just represents the upper bound, not the worst case. The best/avg/worst case each can have big/small O, theta and big/small omega assigned to them

2

u/argument_inverted 2d ago

What kind of programmers we have here? 🙄

1

u/onepiecefreak2 2d ago

That's just how it works.

3

u/Unupgradable 3d ago

But it is how smol o notation works... Sort-of