15 Dynamic Programming Flashcards

1
Q

How is dynamic programming similar to divide and conquer?

A

Both solve complex problems by breaking them into smaller, easier to solve subproblems.

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

How is dynamic programming different to divide and conquer?

A

The subproblems solved by dynamic programming are not independent, and are repeatedly encountered in different contexts.

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

What is Dynamic Programming effective for?

A

Problems where the same subproblem needs to be solved repeatedly.

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

Every dynamic programming algorithm uses:

A

A table that has one entry for each subproblem.

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

The development of a dynamic programming has 3 Key components:

A
  1. The recurrence relation (for defining the value of an optimal solution)
  2. The tabular computation (for computing the value of an optimal solution)
  3. The traceback (for extracting an optimal solution).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Longest common String Running Time

A

O(m*n)

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