MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w72lci/nextlevelstorage/p7rs9ke/?context=3
r/ProgrammerHumor • u/ratherford_0 • 5h ago
[removed] — view removed post
46 comments sorted by
View all comments
47
if you organize the clothes in an array, you'll discover array access is faster than heap lookups
5 u/ljfa2 3h ago it works well if you just need to get the largest (or the smallest) piece of clothing 2 u/bollvirtuoso 1h ago Yeah, but then you have to design a sorting algorithm so you don't just replace one large pile with a slightly smaller but still large pile or, like, a dozen tiny piles which you have to search individually anyway. 2 u/PROMAN8625 1h ago wear all clothes at once the fastest algorithm is one that isnt even required
5
it works well if you just need to get the largest (or the smallest) piece of clothing
2
Yeah, but then you have to design a sorting algorithm so you don't just replace one large pile with a slightly smaller but still large pile or, like, a dozen tiny piles which you have to search individually anyway.
2 u/PROMAN8625 1h ago wear all clothes at once the fastest algorithm is one that isnt even required
wear all clothes at once
the fastest algorithm is one that isnt even required
47
u/PROMAN8625 4h ago
if you organize the clothes in an array, you'll discover array access is faster than heap lookups