complexities Flashcards
1
Q
fibonacci dynamic programming complexity
A
time: O(n)
2
Q
matrix chain multiplication – DP
A
time: O(n^3)
3
Q
knapsack – DP
A
time: O(nW), number of items * max_weight
space: also O(nW)
4
Q
longest common subsequence – dp
A
O(nm), length of first string * length of second string