Re:How to pair socks from a pile efficiently?
by coldcode on Tuesday April 29, 2014 @09:04AM
(#7666641)
The real world meets the world of algorithms. I solve the issue by buying only 1 color and type of sock.
[ Parent
| on HN ]
Fragile - potential to fall apart at Christmas!
My cunning plan is to fold the top of one sock over the other, so they come out ready paired.
Spawning a child is a great answer though.
Re:How to pair socks from a pile efficiently?
by bovermyer on Tuesday April 29, 2014 @09:38AM
(#7666855)
What happens when your brand/model is discontinued?
Re:How to pair socks from a pile efficiently?
by privong on Tuesday April 29, 2014 @09:50AM
(#7666932)
I had this happen a few years ago, though in a slightly different fashion. The same "model" of sock was around, but the design changed once (width of stripes) and the material/construction quality changed several times. So despite having had ~15 pairs of the "same" socks, I still had to match because otherwise they would feel different on my feet. That's obviously not an issue in the grand scheme of things, but it bothered me :)
Re:How to pair socks from a pile efficiently?
by coldcode on Tuesday April 29, 2014 @09:55AM
(#7666960)
realloc() - delete all and buy new ones.
Re:How to pair socks from a pile efficiently?
by notduncansmith on Tuesday April 29, 2014 @09:05AM
(#7666650)
It's worked for me for just shy of a decade.
Re:How to pair socks from a pile efficiently?
by yen223 on Tuesday April 29, 2014 @09:08AM
(#7666667)
Exactly. O(1) FTW!
well considering that the number of socks is limited by the number of atoms in the universe, we can make pretty much any time-bound algorithm O(1)