Sorting by two criteria

Report a typo

You have a list of students with their grades:

  • Johnson C
  • Harris A
  • Miller C
  • Smith B
  • Taylor A

The list is sorted alphabetically. Now you need to sort it by grades (A-B-C), but you want to preserve the alphabetic order as well. So that among students with A, Harris comes first, then Taylor, and so on. What kind of algorithm do you need for this task?

Select one option from the list
___

Create a free account to access the full topic