AlgoScope

Brute Force

Try every candidate. Correct by construction, the baseline to beat.

Algorithmic paradigms, paradigm, beginner
Before searching: how many pairs can there be among 6 values?80311526311445ij
Before searching: how many pairs can there be among 6 values?80311526311445ij

Brute Force: Found near the end

Decision, step 2 of 17

The search space is every pair (i, j) with i before j. That is the whole cost of brute force: the size of the space, since each candidate is checked in constant time.

Cost

Space
O(1)