[Algorithm] Dynamic Programming-1(Definition, Fibonacci)
Dynamic programming is a method for solving large problems by breaking them down into smaller subproblems. This way, you avoid having to repeat the solutions to each subproblem multiple times, allowing you to solve the overall problem much faster. This approach typically works well when a problem has two characteristics: -Optimal substructure Optimal substructure means that the optimal solution to the overall problem can be constructed from the optimal solutions to its subproblems -Overlapping subproblems Overlapping subproblems means that the same subproblems recur many times. Let's see the fibonacci sequence. When solving n'th term of sequence, recursion is very easy way. def fibonacci (n): if n <= 2 : return 1 else : return fibonacci(n - 1 ) + fibonacci(n - 2 ) In this code, there are too many calculation. For example, fibonacci(5) When you compute fibonacci(5), you go through the process as described above. From the diagram, you can see that op...