Instructors can find out how well students understand how to select a sorting algorithm for reordering a list that's already been sorted under a different criterion.
Read the following scenario and answer the two questions. Be certain to back up your decisions.
You have been given a file of all the undergraduates majoring in computer science at your university. This list contains each student's name and and GPA ans is sorted in alphabetical order by their names. Your task is to sort the students by their GPAs (note that if two students have the same GPA, they should then be sorted by their names).
Student answers will vary greatly. There are two key points to focus on, though. The first is to see if students mention using a stable sort to resort the list. Secondly, do students discuss computational efficiency? This point is of particular value on question 2.
Read through the applications and sort or mark them as "Good," "Acceptable," "Marginal," or "Wrong." Read through the piles again to make sure that you have not accidently misclassified a response. You might also want to sort the responses by the type of sorting algorithm used.
Choose three or four of the best examples from the "Good" pile. Emphasize understandability, but try to have a diversity of example domains. Also consider a few acceptable and marginal responses that highlight points you wish to discuss.
If you use an application in class as a bad or poor example, change the application just enough to disguise the example from the original authors.