homework soln about sorting algorithms