Search⌘ K
AI Features

Is Plain Recursion Good Enough?

Understand the inefficiency of plain recursion caused by repeated computations and high time complexity. This lesson helps you recognize the limitations of brute force recursion and prepares you to learn dynamic programming techniques that optimize algorithm efficiency, reducing redundant calculations and improving run time.

Recursion = brute force

We saw some examples of recursion earlier in this chapter. One recurring theme (pun intended) in all those problems was high time complexity. Why was that the case? Because all those problems required a brute force search. We had to search in the whole solution space to look for an answer. For example, in the permutation challenge, we had to ...