Hacker News new | ask | show | jobs
by MichaelAza 4768 days ago
If I had to quickly assign numbers to buckets using a hash table would be obvious but I would never have thought of using the same ideas for assigning people to lines.

This reminds me of a joke I once heard - if you want the cold soda you need to get to the one in the back of the fridge. That's what you get for implementing the fridge as a stack.

Data structures are all around us, we just need to recognize it.

1 comments

You won't believe this, but we actually have a soda fridge here that has a deque implementation on the door with a note that cold ones will be at the back.

I'll provide a pic if demanded. ;)

That, I need to see.
OK, I misremembered, it's a queue, not a deque. Still: http://imgur.com/a/Yujev#0

Also kinda random since we don't use much Java here. I do like that people debugged it, though.

I've been meaning to cross out the "synchronized" there. It's unnecessary since Queues are already threadsafe.