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):
- What does sorting buy for interval merging?
- Why must the leaderboard sort be stable or fully keyed?
- What does the kth-element question really ask?
Homework
- Before: skim the four student pages; attempt case 1 on paper.
- After: write a five-line pseudocode solution for any case you did not
- Enrichment (optional): the stretch question on each case page.