🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Marks, because the last sort is the main key
  2. B.Name, because it was sorted first
  3. C.Both equally
  4. 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 →