Leggett & Platt interview question

Number sorting algorithm