Technically still O(n) time unless all clothes in pile are visible. If they were all strewn across the floor however you could optimize to O(1), you’re welcome.
You have to scan the whole floor in worst case scenario,unless you know where everything lies it's still O(n)
Assuming peripheral vision and focused vision aren’t parallel processes.
I’m pretty sure vision isn’t single threaded that’d be a huge design flaw.
If you intentionally only keep 1 item of clothes in each color on the chair, then you can hash lookup in o(1). Just get a general view of the pile and then go directly to the, say, red item.
Ok, I'm a programmer, not a biologist. So I’m not sure if that’s how eyes/brains work.
What about color collisions then? Almost all of my clothes are black, I would get a linked list lol
If you write shit code without handling your clothes exceptions, when you try to throw you collection of blacks into your hashmap, then your chair will throw an “An element with the same key already exists in the dictionary.”
One could argue that it would be O(1) because there is an upper limit of how much clothes a room can store and how much clothes he can afford. No one can afford an infinite amount of clothes.
That’s like saying the upper bound on my loop is 1 trillion so therefore my search function with O(n) is actually O(1).
Constant lookup just means if I add one more item it does not increase the time. The relation between the number of items and the lookup time is flat, not linear.
O(1) does not mean we know N to be finite therefore O(a gazillion) = O(1).
Technically it can be O(n) but in reality n (the amount of clothes this case) is not going to be a super high number (OP is not going to have a stack as high as 30 clothes) so searching might as well be roughly O(1).
No sane person is going to have a stack of clothes that is more than 30 clothes high and you can quickly sort through a small stack of clothes very quickly.
In this case n is small and it is going to be a fast operation, but it's still O(n) because there is a difference in how quickly you can search a pile of 5 clothes vs. 30
Additionally, my garbage collection process for my floordrobe requires precious processing power, so for efficiency, I only run it weekly
Your mom is expensive?
🤣
Nah, it’s my brainpower/attention
There is a watchdog process that triggers an interrupt if I get out of hand though (wife)
"What about L2 on the bed and L3 over there in the corner?" -Mom
Higher risk of data degradation tho (wrinkles, dust, accidental spills) and privacy risks (your crush randomly sees your messy space and reconsiders)
Well, if you live in your mom's basement: Her house, her rules.
I'm imagining my basement. Dark, humid, no heating, no water, no electricity, floor's made of sand, access only by an under-floor hatch, and completely chockablock with spiders.
Very cozy.
fast random access? How many times do you take on your dirty clothes from past days?
You cut down on time by not having these discussions with your mother
I get it, but it takes me a while. I don't have an L1 cache.
The L1 cache should be small so that access is very quick. That's why L2 and L3 were invented.
My mom is a software engineer.
Sometimes I use pre-computation for this, moving clothes into cache well before they're needed.
A pile too big will make O(1) really slow lol
Yes, this is listed in Algorithms to Live by: The Computer Science of Human Decisions
. It's a fun little book with lots of these. And yes, it did work on my wife (also in software engineering).
Depends on your access pattern honestly. If you only pick the top one, O(1). If you have to find something O(log n) at best if you are somewhat clever about organizing it, but more likely it is O(n) as it is unsorted
I thought this was from the adhd sub.
I don't seem to understand.
Your submission was removed for the following reason:
Rule 2: Content that is part of top of all time, reached trending in the past 2 months, or has recently been posted, is considered a repost and will be removed.
If you disagree with this removal, you can appeal by sending us a modmail.