Intro

Complete search and brute force.

Complete search (brute force) examines all possible solutions to find the answer. It's often the first approach and sometimes the only approach.

When to use:

  • Small input size (n20n \leq 20 for O(2n)O(2^n), n10n \leq 10 for O(n!)O(n!)).
  • No efficient algorithm exists.
  • As a baseline to verify optimized solutions.

I'll show you enumeration techniques, meet-in-the-middle optimization, and how to estimate if brute force will pass time limits.