Math 2.0

Computer science Definition

Divide-and-conquer algorithm

Builds on AlgorithmRecurrence relation

Definition

Let II be a set of problem instances with a size function ∣⋅∣ ⁣:I→ℕ\abs{\cdot} \colon I \to \N. A divide-and-conquer algorithm on II is a recursive algorithm given by:

  1. a direct method that solves every instance of size at most a constant n0n_0;
  2. a divide step that maps each instance xx with ∣x∣>n0\abs{x} > n_0 to finitely many instances x1,…,xax_1, \dots, x_a of II with ∣xi∣<∣x∣\abs{x_i} < \abs{x};
  3. a combine step that computes the solution of xx from the solutions of x1,…,xax_1, \dots, x_a.

On an instance of size greater than n0n_0, the algorithm divides, solves each xix_i recursively, and combines.

Remarks

Clause 2 makes the recursion terminate, since the sizes strictly decrease in ℕ\N. If dividing and combining cost f(n)f(n) and each subproblem has size about n/bn/b, the running time satisfies the recurrence T(n)=a T(n/b)+f(n)T(n) = a\,T(n/b) + f(n).

Example: Karatsuba multiplication of two nn-digit numbers writes x=x1B+x0x = x_1 B + x_0 and y=y1B+y0y = y_1 B + y_0 with BB a power of the base of about half the length, and uses xy=x1y1B2+((x1+x0)(y1+y0)−x1y1−x0y0)B+x0y0x y = x_1 y_1 B^2 + \big((x_1 + x_0)(y_1 + y_0) - x_1 y_1 - x_0 y_0\big) B + x_0 y_0. This needs three recursive products of about half size instead of four, so T(n)=3T(n/2)+O(n)T(n) = 3T(n/2) + O(n) and T(n)=O(nlog⁡23)T(n) = O(n^{\log_2 3}).

Non-example: a recursion that reduces an instance of size nn to an instance of the same size nn fails clause 2, and it need not terminate.

Reading path

To understand this page from the ground up, read these 3 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Algorithm concept
  2. Recurrence relation concept
  3. Divide-and-conquer algorithm definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Divide-and-conquer_algorithm
About this page
TagZYDZME1BH3
URIm2://ZYDZME1BH3
Kinddefinition
WritingW0 stub
MSC68W40, 68W01
DefinesDivide-and-conquer algorithm
UsesAlgorithm, Recurrence relation
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.