The Pattern

Get to know about common recursive patterns, such as divide and conquer and backtracking.

How it works

Both merge-sort and quick-sort follow a general three-step pattern called divide and conquer. It works as follows:

  1. Divide the given instance of the problem into several independent smaller instances of exactly the same problem.
  2. Delegate each smaller instance to the Recursion Fairy.
  3. Combine the solutions for the smaller instances into the final solution

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy