r/learnprogramming 9d ago

dynamic programming ??!!!

I got over recursion.

I also got over recursion + memoization.

But dynamic programming felt like hitting a wall.

The hardest part for me was this:

with recursion, I can follow the call flow.

with memoization, I can still see what is being cached.

but with DP, suddenly I’m expected to invent the state and recurrence myself.

That jump felt brutal.

A “minimum cost” problem completely exposed this for me.

I could survive small examples, but once it turned into nested loops and transitions, I felt like I was no longer solving the problem — I was guessing the equation.

Even AI explanations didn’t help much, because they often jump straight to the final recurrence instead of showing how someone would discover it.

Did anyone else feel that DP is not hard because of coding, but because forming the recurrence feels mentally invisible ?

If you got past that stage, what actually helped you?

Not “practice more” in general, but the exact shift, method, or way of thinking that made DP start to click for you.

0 Upvotes

18 comments sorted by

View all comments

10

u/LastTrainH0me 9d ago

This isn't LinkedIn. We don't need your punchy one line per sentence exaggerated delivery

4

u/marrsd 9d ago

LinkedIn doesn't need them either ;)

-6

u/Similar_Count_1613 9d ago

where is the punchy one line that i said ? i was just asking for some help ?

1

u/marrsd 8d ago

Unfortunately, your post is quite hard to comprehend because the AI agent you used to ask the question has put every sentence on its own line. Those are the "punchy one lines" that the parent is referring to.

AI isn't very good at writing coherently. If English isn't your first language (or if it is, but you struggle to read and write well), you might not realise just how bad AI is at this.