BeginnerTopic 31 of 104Software & Computing

Divide and conquer

Split a problem, solve parts, and combine; merge sort is a classic.

In depth

Divide and conquer splits a problem into smaller independent subproblems, solves them recursively and combines results: merge sort, quicksort, binary search, FFT, Karatsuba, Strassen. Complexity via recurrences T(n)=aT(n/b)+f(n) and the master theorem.

Key points

  • Recurrence relations
  • Parallelisable
  • Base case thresholds
Example

Merge sort halves the list, sorts each half and merges in linear time.

Why it matters

Divide and conquer breaks a problem into independent parts and combines the answers, which yields efficient algorithms like merge sort.

Where this is used

  • Sorting a very large array by splitting it into halves.
  • Finding the closest pair of points in a plane.
  • Multiplying large integers with a faster method than the schoolbook approach.

Frequently asked questions

What is Divide and conquer?

Split a problem, solve parts, and combine; merge sort is a classic.

Why is it important to understand divide and conquer?

Divide and conquer breaks a problem into independent parts and combines the answers, which yields efficient algorithms like merge sort.

What is the typical running time pattern?

Work of the form T(n) equals two T(n over 2) plus linear work gives n log n time, as in merge sort.

What is the difference from dynamic programming?

Divide and conquer subproblems are independent, while dynamic programming subproblems overlap and their results are reused.

How is Divide and conquer used in practice?

Typical applications include sorting a very large array by splitting it into halves, finding the closest pair of points in a plane and multiplying large integers with a faster method than the schoolbook approach.

What should I learn before Divide and conquer?

Study "Greedy algorithms" first (topic 30 of 104 in Software & Computing). It covers the groundwork this topic builds on.

What are the key points of Divide and conquer?

Recurrence relations. Parallelisable. Base case thresholds.

Can you give an example of Divide and conquer?

Merge sort halves the list, sorts each half and merges in linear time.

What comes after Divide and conquer?

The next topic is "Backtracking", which builds directly on this one.

How difficult is Divide and conquer?

It is classed as Beginner in Software & Computing (topic 31 of 104). It is an entry-level topic. It relies only on basic school mathematics and the ideas introduced earlier in this discipline.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.

Related topics