# Divide and Conquer

> Cutting a big problem into small ones like it. Solve each, then join the answers.

**Field:** Software Development  
**Category:** Algorithms & Data Structures  
**Also known as:** Divide-and-Conquer Algorithm

## Think of it like

Think of it like cleaning a big house. Split it into rooms, clean each, and the house is done.

## Definition

Divide and conquer cuts a big problem into smaller copies of itself. Each small piece is solved, often by splitting again, until the pieces are tiny. Then the answers are joined to answer the big problem. Merge sort, quicksort and binary search all work this way. It is usually written with recursion.

## Example

Lucy's merge sort splits 1,000 names into halves, then quarters, down to single names. Joining them back gives one sorted list.

## Why it matters

It turns many slow O(n²) problems into fast O(n log n) ones.

## Common mistake

Splitting a problem whose pieces overlap. Then one piece is solved again and again. Dynamic programming fits better.

## Three principles

- **Split.** Into smaller copies.
- **Solve each.** Often by splitting again.
- **Join.** The answers into one.

## Related terms

- [Merge Sort](https://learn.benibix.com/term/development/merge-sort)
- [Quicksort](https://learn.benibix.com/term/development/quicksort)
- [Recursion](https://learn.benibix.com/term/development/recursion)
- [Dynamic Programming](https://learn.benibix.com/term/development/dynamic-programming)

## Told apart from

- [Divide and Conquer vs Dynamic Programming](https://learn.benibix.com/compare/divide-and-conquer-vs-dynamic-programming): Divide and conquer and dynamic programming both cut a big problem into small parts to solve one at a time. In the first, each part is new. In the second, the same parts come back, so each answer is saved and used again.

---

Source: https://learn.benibix.com/term/development/divide-and-conquer
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
