Dynamic Programming Study Cards

Enhance Your Learning with Dynamic Programming Flash Cards for quick learning



Dynamic Programming

A method for solving complex problems by breaking them down into simpler overlapping subproblems and solving each subproblem only once, storing the results for future use.

Optimal Substructure

A property of problems that can be solved optimally by breaking them down into smaller subproblems and combining their solutions.

Overlapping Subproblems

A property of problems where the solution to a problem depends on the solutions to smaller instances of the same problem, leading to redundant computation.

Memoization

A technique in dynamic programming where the results of expensive function calls are stored and reused to avoid redundant computation.

Tabulation

A technique in dynamic programming where the results of subproblems are stored in a table and used to solve larger problems.

Top-Down Approach

A recursive approach in dynamic programming where the problem is divided into smaller subproblems, and the solutions to these subproblems are computed on demand.

Bottom-Up Approach

An iterative approach in dynamic programming where the problem is solved by solving all possible subproblems in a bottom-up manner, starting from the smallest subproblems.

Fibonacci Sequence

A sequence of numbers where each number is the sum of the two preceding ones, often used as an example in dynamic programming.

Knapsack Problem

A problem where given a set of items with weights and values, the goal is to find the most valuable combination of items that can be carried in a knapsack with a given weight capacity.

Longest Common Subsequence

A problem where given two sequences, the goal is to find the longest subsequence that is common to both sequences.

Matrix Chain Multiplication

A problem where given a sequence of matrices, the goal is to find the most efficient way to multiply these matrices together.

Coin Change Problem

A problem where given a set of coin denominations and a target amount, the goal is to find the minimum number of coins needed to make up that amount.

Edit Distance

A problem where given two strings, the goal is to find the minimum number of operations required to transform one string into the other, where the allowed operations are insertion, deletion, and substitution.

Traveling Salesman Problem

A problem where given a list of cities and the distances between each pair of cities, the goal is to find the shortest possible route that visits each city exactly once and returns to the starting city.

0/1 Knapsack Problem

A variation of the knapsack problem where each item can be taken only once, either completely or not at all.

Rod Cutting Problem

A problem where given a rod of length n and a price list for different lengths, the goal is to find the maximum value obtainable by cutting up the rod and selling the pieces.

Subset Sum Problem

A problem where given a set of integers and a target sum, the goal is to determine whether there is a subset of the integers that adds up to the target sum.

Binomial Coefficient

A problem where given two non-negative integers n and k, the goal is to compute the binomial coefficient C(n, k), which represents the number of ways to choose k items from a set of n items.

Bellman-Ford Algorithm

An algorithm for finding the shortest paths from a single source vertex to all other vertices in a weighted directed graph, even in the presence of negative edge weights.

Floyd-Warshall Algorithm

An algorithm for finding the shortest paths between all pairs of vertices in a weighted directed graph, using a dynamic programming approach.

Dijkstra's Algorithm

An algorithm for finding the shortest paths from a single source vertex to all other vertices in a weighted directed graph, with non-negative edge weights.

Longest Increasing Subsequence

A problem where given a sequence of numbers, the goal is to find the longest subsequence that is strictly increasing.

Maximum Subarray Sum

A problem where given an array of numbers, the goal is to find the contiguous subarray with the largest sum.

Partition Problem

A problem where given a set of numbers, the goal is to partition the set into two subsets such that the difference between the sums of the subsets is minimized.

Palindrome Partitioning

A problem where given a string, the goal is to partition the string into as few substrings as possible, such that each substring is a palindrome.

Word Break Problem

A problem where given a string and a dictionary of words, the goal is to determine whether the string can be segmented into a space-separated sequence of dictionary words.

Minimum Cost Path

A problem where given a grid with non-negative weights on each cell, the goal is to find the minimum cost path from the top-left cell to the bottom-right cell, moving only right or down.

Longest Palindromic Subsequence

A problem where given a string, the goal is to find the longest subsequence that is a palindrome.

Longest Common Substring

A problem where given two strings, the goal is to find the longest substring that is common to both strings.

Maximum Product Subarray

A problem where given an array of numbers, the goal is to find the contiguous subarray with the largest product.

Minimum Edit Distance

A problem where given two strings, the goal is to find the minimum number of operations required to transform one string into the other, where the allowed operations are insertion, deletion, and substitution, with different costs for each operation.

Longest Repeated Subsequence

A problem where given a string, the goal is to find the longest subsequence that appears more than once in the string.

Longest Bitonic Subsequence

A problem where given a sequence of numbers, the goal is to find the longest subsequence that is first increasing and then decreasing.

Longest Alternating Subsequence

A problem where given a sequence of numbers, the goal is to find the longest subsequence that alternates between increasing and decreasing.

Longest Zigzag Subsequence

A problem where given a sequence of numbers, the goal is to find the longest subsequence that alternates between positive and negative differences.

Longest Increasing Subarray

A problem where given an array of numbers, the goal is to find the longest subarray that is strictly increasing.

Longest Decreasing Subarray

A problem where given an array of numbers, the goal is to find the longest subarray that is strictly decreasing.

Longest Increasing Substring

A problem where given a string, the goal is to find the longest substring that is strictly increasing when the characters are interpreted as numbers.

Longest Decreasing Substring

A problem where given a string, the goal is to find the longest substring that is strictly decreasing when the characters are interpreted as numbers.

Longest Mountain Subarray

A problem where given an array of numbers, the goal is to find the longest subarray that forms a mountain shape, increasing and then decreasing.

Longest Mountain Subsequence

A problem where given a sequence of numbers, the goal is to find the longest subsequence that forms a mountain shape, increasing and then decreasing.

Longest Bitonic Subarray

A problem where given an array of numbers, the goal is to find the longest subarray that forms a bitonic shape, increasing and then decreasing.

Longest Bitonic Substring

A problem where given a string, the goal is to find the longest substring that forms a bitonic shape, increasing and then decreasing when the characters are interpreted as numbers.

Longest Alternating Subarray

A problem where given an array of numbers, the goal is to find the longest subarray that alternates between increasing and decreasing.

Longest Alternating Substring

A problem where given a string, the goal is to find the longest substring that alternates between increasing and decreasing when the characters are interpreted as numbers.

Longest Zigzag Subarray

A problem where given an array of numbers, the goal is to find the longest subarray that alternates between positive and negative differences.

Longest Zigzag Substring

A problem where given a string, the goal is to find the longest substring that alternates between positive and negative differences when the characters are interpreted as numbers.