complexities Flashcards

1
Q

fibonacci dynamic programming complexity

A

time: O(n)

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

matrix chain multiplication – DP

A

time: O(n^3)

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

knapsack – DP

A

time: O(nW), number of items * max_weight
space: also O(nW)

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

longest common subsequence – dp

A

O(nm), length of first string * length of second string

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