Workspace Divide And Conquer
0d
Problem-solving patterns

Divide and Conquer

Split, solve smaller disjoint instances and combine their results.

Recognition signal

Two halves can be solved independently.

Method

Choose a decreasing split and write the work required to combine.

Worked example

Merge sort has logarithmically many levels, each merging a total of n items.

Common mistake

Dividing in half does not guarantee logarithmic work if both halves are visited.