Dynamic Programming Flashcards

1
Q

What are overlapping subproblems?

A

A problem has overlapping subproblems if finding its solution involves solving the same subproblem multiple times.

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

What is dynamic programming?

A

Dynamic programming is an algorithms design technique which solves problems by combining the solutions to subproblems. It applies when subproblems overlap.

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

Which kinds of problems does dynamic programming typically apply to?

A

OPTIMIZATION PROBLEMS. These problems have many possible solutions, and each has a value, and we wish to find a solution with the optimal value.

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

What are the steps that need to be followed when developing dynamic programming algorithm

A
  1. Characterize the structure of an optimal solution.
  2. Recursively define the value of an optimal solution.
  3. Compute the value of an optimal solution, typically in a bottom-up fashion.
  4. Construct an optimal solution from computed information (If only the value is needed this step can be ommited).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are two ways to implement a dynamic programming approach?

A
  • Top-down with memoization

- Bottom-up

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

What is the trade-off that dynamic programming makes?

A

It uses additional memory to save computation time.

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

What are some typical dynamic programming problems?

A
  • Rod cutting

- Matrix chain multiplication

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