Divide-and-conquer algorithm (source code)

= Divide-and-conquer algorithm
{wiki=Divide-and-conquer_algorithm}

Divide-and-conquer is a fundamental algorithm design paradigm characterized by three main steps: 1. **Divide**: The problem is divided into smaller subproblems, ideally of roughly equal size. These subproblems are similar in nature to the original problem but smaller in scope. 2. **Conquer**: Each of the subproblems is solved individually. If the subproblems are still too large or complex, they can be further divided and solved recursively.