Day 12 Practice Questions
Three interview classics where choosing the right sort is the entire trick. Each one has multiple legitimate approaches — the interesting question is which one wins, and why.
These problems test the decision tree from the previous page. For each, ask: do I need to fully sort? Do I need stability? Could I use partitioning instead? Could counting sort help?
Medium
| Problem | Pattern | Status |
|---|---|---|
| Kth Largest Element in an Array | Quickselect / heap | Available |
| Top K Frequent Elements | Counting + bucket sort | Available |
| Sort Characters By Frequency | Counting + bucket sort | Available |
More Practice (Coming Soon)
| Problem | Pattern | Status |
|---|---|---|
| H-Index | Counting sort | Coming Soon |
| Wiggle Sort II | Quickselect + interleave | Coming Soon |
| Sort an Array | Pick your sort | Coming Soon |
| Largest Number | Custom comparator | Coming Soon |
| K Closest Points to Origin | Quickselect / heap | Coming Soon |
| Maximum Gap | Bucket sort | Coming Soon |