Dynamic Problem Approaches Flashcards

1
Q

Memoization (Top-Down DP)

A

Start with the problem and break it into smaller subproblems, caching the results to avoid redundant calculations.

Example:
Fibonacci with memoization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Tabulation (Bottom-Up DP)

A

Iteratively solve smaller subproblems first and store their solutions in a table, building up to the solution of the main problem.

Example:
LCS, Knapsack problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State Transition DP

A

Used in more complex problems where multiple states are involved (e.g., DP on trees, graphs, or paths).

Example:
Longest Increasing Subsequence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Greedy + DP

A

Combining greedy strategies with dynamic programming when greedy alone isn’t sufficient.

Example:
Weighted Job Scheduling with profit maximization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly