chapter3 queue and sort stack exercises