Top 50 dynamic programming practice Problems
Dynamic Programming is a method to solve a complex problem by dividing it into a collection of simpler subproblems, solving each of those subproblems only once, and storing their solutions using a memory-based data structure (matrix, map, etc.). Each of the subproblem solutions is indexed in some way, typically based on the values of its input parameters, to facilitate its search. Then, the next time the same subproblem occurs, instead of recalculating your solution, one simply searches for the previously calculated solution, which saves computing time. This technique of storing solutions to subproblems instead of recalculating them is called memoization.
Here is a brilliant explanation of the concept of dynamic programming in Quora: Jonathan Paulson's answer to How should I explain dynamic programming to a 4-year-old?
Below, you will find the 50 most common problems in the data structure that can be solved by dynamic programming:
- · The longest common subsequence | Introduction and LCS length
- · The longest common subsequence | Finding all the LCS - Techie Delight
- · The longest problem with common substrings - Techie Delight
- · Longest palindromic subsequence using dynamic programming
- · The problem of repeated subsequences longer - Techie Delight
- · Implement the Diff utility - Techie Delight
- · Shorter the common supersequence | Introduction, and length SCS
- · Shorter the common supersequence | Finding all the SCS - Techie Delight
- · Longest growing subsequence using dynamic programming - Techie Delight
- · Longest bitonic sequence - Techie Delight
- · Increase of the subsequence with the maximum sum - Techie Delight
- · The problem of distance Levenshtein (Edit distance) - Techie Delight
- · Find the size of the secondary matrix larger than 1 present in a given binary matrix - Techie Delight
- · Matrix chain multiplication using dynamic programming
- · Find the minimum cost to reach the last cell in the matrix from your first cell - Techie Delight
- · Find the longest sequence formed by adjacent numbers in the matrix: Techie Delight
- · Count the number of routes in a matrix with a certain cost to reach the destination cell
- o backpack problem - Techie Delight
- · Maximize the value of an expression - Techie Delight
- · Partition problem Dynamic programming solution - Techie Delight
- · Subset sum problem - Techie Delight
- · Minimal sum partition problem - Techie Delight
- · Find all the N-digit binary strings without any consecutive 1 - Techie Delight
- · Rod Cutting Problem - Techie Delight
- · Maximum cut of product bars - Techie Delight
- · Currency exchange problem (unlimited supply of coins) - Techie Delight
- · Currency exchange problem (Total number of ways to obtain denomination of coins) - Techie Delight
- · The biggest problem of alternate subsequences: Techie Delight
- · Number of times a pattern appears in a given string as a subsequence
- · Collect the maximum points in a matrix satisfying the given constraints - Techie Delight
- · Count the total number of possible combinations of N-digit numbers on a mobile keyboard: Techie Delight
- · Find the optimal cost to build a binary search tree - Techie Delight
- · Word Break Problem | Dynamic programming - Techie Delight
- · Word Break Problem | Using the data structure Trie - Techie Delight
- · Total possible solutions for the linear equation of k variables - Techie Delight
- · Matching wild pattern - Techie Delight
- · Find the probability that a person is alive after giving N steps on an island
- · Calculate the sum of all the elements in a sub-matrix in constant time - Techie Delight
- · Find the maximum sum submatrix in a given matrix - Techie Delight
- · Find the maximum sum submatrix present in a given matrix - Techie Delight
- · Find the maximum sum of subsequences without adjacent elements: Techie Delight
- · Maximum subarray problem ( Kadane algorithm ) - Techie Delight
- · Shortest routes from a single source: Bellman-Ford algorithm - Techie Delight
- · The shortest paths of all pairs: Floyd Warshall algorithm - Techie Delight
- · Game of gold pots using dynamic programming - Techie Delight
- · Find the minimum cuts necessary for the palindromic partition of a string
- · Snake sequence maximum length - Techie Delight
- · 3 partitioning problem - Techie Delight
- · Calculate the size of the largest of 1 in the binary matrix: Techie Delight
- · Check if the given string is interspersed with two other given chains