ProgrammerHumor

doYouGetIt

doYouGetIt
https://i.redd.it/77j9v4lv79ef1.jpeg
Reddit

Discussion

ProgrammerHumor-ModTeam
:ath:

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.

22 hours ago
bassguyseabass
:cp:

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.

1 day ago
Sunrider37

You have to scan the whole floor in worst case scenario,unless you know where everything lies it's still O(n)

1 day ago
bassguyseabass
:cp:

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.

1 day ago
Muchmatchmooch

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. 

1 day ago
Sunrider37

What about color collisions then? Almost all of my clothes are black, I would get a linked list lol

23 hours ago
Muchmatchmooch

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.”

21 hours ago
gerbosan

Can I say I'm a dev?

Though not sure if that's a good thing.

23 hours ago
YuriTheWebDev

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.

1 day ago
bassguyseabass
:cp:

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).

1 day ago
YuriTheWebDev

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.

23 hours ago
alien13222

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

23 hours ago
davak72
:cs::j::re::msl::bash:

Additionally, my garbage collection process for my floordrobe requires precious processing power, so for efficiency, I only run it weekly

1 day ago
lakimens

Your mom is expensive?

22 hours ago
davak72
:cs::j::re::msl::bash:

🤣

21 hours ago
davak72
:cs::j::re::msl::bash:

Nah, it’s my brainpower/attention

21 hours ago
davak72
:cs::j::re::msl::bash:

There is a watchdog process that triggers an interrupt if I get out of hand though (wife)

21 hours ago
SuperManIey

"What about L2 on the bed and L3 over there in the corner?" -Mom

1 day ago
blackscales18

Higher risk of data degradation tho (wrinkles, dust, accidental spills) and privacy risks (your crush randomly sees your messy space and reconsiders)

1 day ago
TheExplorer0110

1 day ago
TheActualJonesy

Well, if you live in your mom's basement: Her house, her rules.

1 day ago
thanatica

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.

1 day ago
Tupcek

fast random access? How many times do you take on your dirty clothes from past days?

1 day ago
Throwaway_987654634

You cut down on time by not having these discussions with your mother

1 day ago
RestInProcess

I get it, but it takes me a while. I don't have an L1 cache.

1 day ago
Thesaurius
:rust:

The L1 cache should be small so that access is very quick. That's why L2 and L3 were invented.

1 day ago
Own-Competition-7913

My mom is a software engineer.

1 day ago
Henry_Fleischer

Sometimes I use pre-computation for this, moving clothes into cache well before they're needed.

1 day ago
Dhayson
:rust:

A pile too big will make O(1) really slow lol

1 day ago
made-of-questions

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).

23 hours ago
exomyth

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

23 hours ago
M00baka

I thought this was from the adhd sub.

1 day ago
msnshame

I don't seem to understand.

1 day ago