← Quiz: Sorting, heapq and bisect: all 10 questions
Quiz: Sorting, heapq and bisect · Question 3 of 10
You sort by name first and then by marks with a second stable sort. Which key decides the final order most?
You sort by name first and then by marks with a second stable sort. Which key decides the final order most?
- A.Marks, because the last sort is the main key
- B.Name, because it was sorted first
- C.Both equally
- D.Neither; the second sort undoes the first
Answer & explanation
Correct answer: Marks, because the last sort is the main key
The last pass is the primary key; the earlier pass only breaks ties.
Can you get the rest right without peeking?
Take the timed Quiz: Sorting, heapq and bisect quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →