Implement Merge Sort and Quickselect

divide and conquer, partitioning

Challenge 1 of Recursion, Greedy & DPIntermediate~55 minFree

Build divide-and-conquer sorting from the ground up: merge two sorted lists, grow that into merge sort, implement Lomuto partition for quicksort, reuse partition for O(n)-average quickselect (top-K queries), and finish with a stable key-based sort for ordering records. A practical toolkit for ordering data and answering k-th smallest queries.

5 steps

  1. 1Merge two sorted lists
  2. 2Merge sort
  3. 3Partition and quicksort
  4. 4Quickselect for top-K
  5. 5Stable sort by key
Start step 1