## Python Program to Solve 0-1 Knapsack Problem using Dynamic Programming with Bottom-Up Approach

This is a Python program to solve the 0-1 knapsack problem using dynamic programming with bottom-up approach. Problem Description In the 0-1 knapsack problem, we are given a set of n items. For each item i, it has a value v(i) and a weight w(i) where 1

## Python Program to Find Longest Common Substring using Dynamic Programming with Bottom-Up Approach

This is a Python program to find longest common substring or subword (LCW) of two strings using dynamic programming with bottom-up approach. Problem Description A string r is a substring or subword of a string s if r is contained within s. A string r is a common substring of s and t if r … Read more

## Python Program to Find Longest Common Substring using Dynamic Programming with Memoization

This is a Python program to find longest common substring or subword (LCW) of two strings using dynamic programming with top-down approach or memoization. Problem Description A string r is a substring or subword of a string s if r is contained within s. A string r is a common substring of s and t … Read more

## Python Program to Find Longest Common Subsequence using Dynamic Programming with Bottom-Up Approach

This is a Python program to find longest common subsequence (LCS) of two strings using dynamic programming with bottom-up approach. Problem Description A string r is a subsequence of a string s if r can be obtained from s by dropping zero or more characters from s. A string r is a common subsequence of … Read more

## Python Program to Find Longest Common Subsequence using Dynamic Programming with Memoization

This is a Python program to find longest common subsequence (LCS) of two strings using dynamic programming with top-down approach or memoization. Problem Description A string r is a subsequence of a string s if r can be obtained from s by dropping zero or more characters from s. A string r is a common … Read more

## Python Program to Solve Matrix-Chain Multiplication using Dynamic Programming with Bottom-Up Approach

This is a Python program to solve matrix-chain multiplication using dynamic programming with bottom-up approach. Problem Description In the matrix-chain multiplication problem, we are given a sequence of matrices A(1), A(2), …, A(n). The aim is to compute the product A(1)…A(n) with the minimum number of scalar multiplications. Thus, we have to find an optimal … Read more

## Python Program to Solve Matrix-Chain Multiplication using Dynamic Programming with Memoization

This is a Python program to solve matrix-chain multiplication using dynamic programming with top-down approach or memoization. Problem Description In the matrix-chain multiplication problem, we are given a sequence of matrices A(1), A(2), …, A(n). The aim is to compute the product A(1)…A(n) with the minimum number of scalar multiplications. Thus, we have to find … Read more

## Python Program to Print nth Fibonacci Number using Dynamic Programming with Bottom-Up Approach

This is a Python program to print nth Fibonacci number using dynamic programming with bottom-up approach. Problem Description Fibonacci numbers are defined by the sequence f(0) = 0, f(1) = 1 and f(n) = f(n – 1) + f(n – 2) for n >= 2. The program prompts the user to enter n and it … Read more

## Python Program to Print nth Fibonacci Number using Dynamic Programming with Memoization

This is a Python program to print nth Fibonacci number using dynamic programming with top-down approach or memoization. Problem Description Fibonacci numbers are defined by the sequence f(0) = 0, f(1) = 1 and f(n) = f(n – 1) + f(n – 2) for n >= 2. The program prompts the user to enter n … Read more