DDSA Solutions

Sorting

103 problems · 73 with full explanations

13 Easy47 Medium10 Hard
Sorting is often a preprocessing step that enables binary search, two-pointer sweeps, or greedy algorithms. C#'s Array.Sort() uses an introspective sort (O(n log n)). Custom comparisons use the Comparison<T> delegate or IComparer<T>. Consider counting sort or bucket sort for bounded integer inputs.

How to practice

To practice Sorting problems effectively, start with the Easy problems listed below, trace through each solution on paper, then re-implement without looking. When you can recognise the sorting pattern within 30 seconds of reading a new problem, move on to Medium difficulty. Use the related topic pages and our study guide for a structured progression.

Open the full study guide →

Start here (Easy + explained)

All Sorting problems