Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

May have just been the text book I had, but I always had an easier time understanding dynamic programming implemented with memoization rather than tabulation.

Given a well-implemented hash-table, the performance differences generally seemed negligible as well. I didn't understand why it wasn't taught this way to begin with.

This stackoverflow answer only gives vague statements about how tabulation may be more performant than memoization, recursion overhead can generally be avoided with an iterative implementation (not always easy). Does anyone have concrete examples of when tabulation would be preferred?



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: