In this chapter, we have addressed the basic concepts of the optimization techniques. To start, we learned the essential contents underlying the DP. With DP, we subdivide an optimization problem into simpler subproblems. We then proceed to calculate the solutions of all possible subproblems, and starting from subsolutions, we obtain new subsolutions, and carry on until we solve the original problem.
Then, we looked at the difference between recursion and memoization. In DP, this does not happen: we memorize the solution of these subproblems so that we do not have to solve them again; this is called memoization. The idea behind this method is to calculate solutions to subproblems once and store the solutions in a table so that they can be reused (repeatedly) later. To better understand this technique, we looked at a practical case: the calculation of the factorial of a...