Quiz — Lecture 18

Section A from memory, one line each. Section B shows your reasoning - marks are for method, not final answers. Answers are discussed in class; the exit ticket goes on a card.

Section A

A1. What does 'stable sort' preserve?

A2. Give the two-key sort for 'score desc, name asc'.

A3. What is the merge step's guarantee?

A4. Roughly why is sorting O(n log n)?

Section B

B1. Rank ada 90, bo 75, cy 90 (ties alphabetical).

B2. Merge [9, 10, 12] with [9.5, 11]: list the comparisons.

Exit ticket

Answer one of these on your card in 60 seconds (choose any one):

  1. What does sorting buy for interval merging?
  1. Why must the leaderboard sort be stable or fully keyed?
  1. What does the kth-element question really ask?

Homework