29 ms·
For DP? Practice a couple on like HackerRank, CodeFights etc. It starts to make sense after you do a few. For Big O notation? Just think about how many times
by moufestaphio 8y ago
For DP? Practice a couple on like HackerRank, CodeFights etc.
It starts to make sense after you do a few.
For Big O notation? Just think about how many times you're iterating through things (in the worst possible case).
e.g.
Got two nested for loops each going to N.. we're going to loop N on the outer loop, so and each iteration of the inner loop we go through N times? that's N x N so O(N^2).. (easy example obviously).