4 ms·
I've been taught DP via tabulation and struggled to get it. Then I learned the memoization trick and I am never coming back simply because memoization is much e
by lostmsu 3y ago
I've been taught DP via tabulation and struggled to get it. Then I learned the memoization trick and I am never coming back simply because memoization is much easier to reason about, and the resulting code is often much cleaner. As the result, I would only resort to tabulation if I need to match some performance goal and memoization does not cut it.