Day 12 - Sorting Algorithms - IIPractice QuestionsOverview

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

ProblemPatternStatus
Kth Largest Element in an ArrayQuickselect / heapAvailable
Top K Frequent ElementsCounting + bucket sortAvailable
Sort Characters By FrequencyCounting + bucket sortAvailable

More Practice (Coming Soon)

ProblemPatternStatus
H-IndexCounting sortComing Soon
Wiggle Sort IIQuickselect + interleaveComing Soon
Sort an ArrayPick your sortComing Soon
Largest NumberCustom comparatorComing Soon
K Closest Points to OriginQuickselect / heapComing Soon
Maximum GapBucket sortComing Soon