dynamic programming Flashcards

1
Q

Dynamic programming(shortcut)

What is optimal solution

A

Used to solve optimization problems(To find optimal solutions)

in optimal solution, we either find maximum value or minimum value

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

Definition of dyn prog

its features

A

Technology that breaks problem into sub problems and saves the result for the future purposes so that we don’t need to compute it again and again
Overlapping sub problems
Features:
1. Optimal substructure property
2.overlapping subproblems

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

Explanation of features of dyn prog

A
  1. Optimal substructure property: problem is divided or divisible into sub trees And solved like divide and conquer
  2. Overlapping sub problems: sub problems will be repeated so solved sub problem can be stored and whenever required again can be used(Not like dividend conquer).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Knapsack problem

A

Suppose we have a knapsack or a bag with a limited capacity and each item has some weight and value
prob Which item should be placed in the back so that weight does not exceed and total value of items is maximum( as much as possible)
eg Suppose there is a thief and hunters in museum he contains a knapsack of limited weight capacity. the museum Contains various items of different values. The thief must decide what he should keep in the bag so that profit would be maximum

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