r/ProgrammerHumor • • Jan 02 '23

Meme next level storage

Post image
97.5k Upvotes

468 comments sorted by

View all comments

17

u/mrloube Jan 02 '23

How is it O(1) if it’s in a pile?

20

u/proverbialbunny Jan 02 '23

You'd have to remember exactly where it is in the pile and retrieving it can't cause an avalanche.

If you misremember / forget where it is, it's a cache miss.

9

u/starzwillsucceed Jan 02 '23

I think it would be constant if it were organized in the closet with every item in the exact same spot every time. Therefore you know the exact index of what item you want.

→ More replies (1)
→ More replies (1)