# Category Archives: Dynamic Programming

What is the 0/1 Knapsack Problem? We are given N items where each item has some weight and profit associated with it. We are also… Read More
The following are the common definitions of Binomial Coefficients.  A binomial coefficient C(n, k) can be defined as the coefficient of x^k in the expansion… Read More
Given the dimension of a sequence of matrices in an array arr[], where the dimension of the ith matrix is (arr[i-1] * arr[i]), the task… Read More
Given an integer array of coins[ ] of size N representing different types of currency and an integer sum, The task is to find the number of… Read More
Given an array arr[] where each element represents the max number of steps that can be made forward from that index. The task is to… Read More
Given a cost matrix cost[][] and a position (m, n) in cost[][], write a function that returns cost of minimum cost path to reach (m,… Read More
Given a cost matrix cost[][] and a position (M, N) in cost[][], write a function that returns cost of minimum cost path to reach (M,… Read More
Given a cost matrix cost[][] and a position (m, n) in cost[][], write a function that returns cost of minimum cost path to reach (m,… Read More
Given a cost matrix cost[][] and a position (m, n) in cost[][], write a function that returns cost of minimum cost path to reach (m,… Read More
Given two strings str1 and str2 and below operations that can be performed on str1. Find minimum number of edits (operations) required to convert ‘str1’… Read More
LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in… Read More
LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in… Read More
LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in… Read More
Given two strings, S1 and S2, the task is to find the length of the longest subsequence present in both of the strings.  Note: A… Read More
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the… Read More