Bead sort (nearly as bad sort)