brute force
Solving a problem by trying every possibility directly, without any clever structure.
In more detail
Brute force is simple and a good correctness reference: the course checks faster algorithms against it on small inputs. It is usually far too slow at scale, such as checking all n^2 subarrays for the maximum sum.
Related terms
- exhaustive search — Trying every possible candidate solution and checking each one.
- maximum subarray problem — The problem of finding the contiguous stretch of an array whose values have the largest sum.
Taught in
- Collisions In Practice And Hash Flooding — Algorithms & Data Structures for Working Engineers
- Divide And Conquer And The Recurrence — Algorithms & Data Structures for Working Engineers
- Backtracking: Search With Pruning — Algorithms & Data Structures for Working Engineers
- Dynamic Programming: Memoisation And Tabulation — Algorithms & Data Structures for Working Engineers