Step 1: Gather Socks
Collect all your socks, no matter their state of affairs.
Sort them by color, then by size, then by material.
Step 2: Analyze Sock Data
Use the most basic of algorithms, like the Bubble Sort.
Compare each sock to the next, and swap if they're out of order.
Step 3: Refine Sock Order
Once you've got your socks in order, you can refine them with a quick pass of Quick Sort.
But don't worry, it's not as quick as it sounds.