Skip to content
Data Structures and Algorithms / Algorithm Design Paradigms

Divide-and-Conquer as a Design Paradigm

This unit has already used divide-and-conquer three times — mergesort and Strassen's algorithm in Topic 1, and quickselect in Topic 2 — without naming the shared template explicitly. This lesson names it: divide the problem into smaller independent subproblems of the same type, conquer each recursively (or solve directly if small enough), and combine the sub-solutions into a solution for the original problem. Recognising this three-step shape in a new problem is often the fastest route to an efficient algorithm — this lesson also distinguishes the "recurse into all subproblems" pattern (mergesort) from the "recurse into only one" pattern (quickselect), since the two give qualitatively different recurrence shapes.

In this lesson

  1. Learning objectives
  2. The template
  3. Two shapes: recurse into all, versus recurse into one
  4. Recognising the pattern in a new problem

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or explore the curriculum.