Skip to main content

2 posts tagged with "memoization"

View All Tags

Wait, Is This Actually DP? A Conversation About Memoization

· 10 min read
Mahmut Salman
Software Developer

A casual conversation between two software engineers about the subtle differences between recursion, memoization, and "real" DP.


The Setup

It's late afternoon at the office. Alex just finished implementing a memoized solution to Min Cost Climbing Stairs and walks over to Jamie's desk with their laptop.

Alex: Hey Jamie, can I bug you for a second? I'm confused about something with DP.

Jamie: [looks up from code review] Sure, what's up?

Alex: So I wrote this solution for the climbing stairs problem. I started with recursion, then added memoization like everyone says. But now I'm wondering... is this actually DP? Or is it still just recursion?

When DP Gets Messy: A Student's Journey Through Delete and Earn

· 10 min read
Mahmut Salman
Software Developer

A dialogue between Professor Chen and Alex, a senior Computer Science student, as they unravel why some DP problems resist the standard recursive → memoization → tabulation pipeline.


The Student's Confusion

Alex: [walks into office hours with laptop open] Professor Chen, I'm really confused about this LeetCode problem I'm working on. I thought I understood DP, but something's not clicking.

Professor Chen: Let's see what you've got. Walk me through it.

Alex: It's LC 740: Delete and Earn. Here's the problem: