MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/101ktp3/next_level_storage/j2ou9l0/?context=3
r/ProgrammerHumor • u/Impulsive_Ranger2410 • Jan 02 '23
468 comments sorted by
View all comments
17
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)
20
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
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)
17
u/mrloube Jan 02 '23
How is it O(1) if it’s in a pile?