Laundry and Data Structures

My clothesline

A little while ago, I was hanging clothes out on the line, and it occurred to me that my mother taught me my first data structure concept: first in, last out. A clothesline is a physical manifestation of a stack.

If you wash the jeans first, and put them on the line first, they can stay out there the longest, because they take the most time to dry. If you hang up your quick-drying workout gear last, you might be ready to take them down and replace them with another load before your jeans have even thought of drying.

Alternatively, if you’ve got enough space on the line, so that you don’t need to cycle things on and off the top of the stack (closest to the house), you may want to hang your most wrinkle-prone clothes out first, so they end up on the top of the pile when everything’s folded in the basket.