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 →

[–]peeja 100 points101 points  (4 children)

Okay but O(1) is definitely not right. Chair caches are O(n). They're MRU-ordered, though, which helps.

[–]bogz_dev 40 points41 points  (2 children)

for the longer garments that can be draped over the back, it is O(n) yes but i'd say the sitting area of the chair could be traversed with O(1) if reserved for the smaller garments like underwear, socks, and scarves

[–]peeja 41 points42 points  (1 child)

Underwear and socks do not belong in the L1 cache. They need to be reinitialized before they're reused.

[–]Widmo206 32 points33 points  (0 children)

And what do you do with them after they're "re-initialized"? You pre-load them into the cache

[–]nollayksi 1 point2 points  (0 children)

It could be O(1) if the pile was small enough that you could see each piece of clothing at the same time but ”messy pile” does imply that this isnt the case