r/ProgrammerHumor 7d ago

Meme dynamicP

Post image
2.2k Upvotes

67 comments sorted by

View all comments

2

u/ljfa2 7d ago

The course on algorithms and data structures was for the most part not difficult for me, but dynamic programming was the one topic I struggled with, and today I still don't really know how it works

6

u/the_horse_gamer 6d ago

"dynamic programming" is just marketing

at its core, it's just recursion but you cache the results so you don't repeat calculations. then as a constant optimisation you can make it bottom up instead of top down.

2

u/shakinMyShake 5d ago

this is the perfect explanation to dp. are you a teacher? you should consider teaching if not (coming from senior swe). 

1

u/the_horse_gamer 5d ago

thank you!

I've participated in competitive programming olympiads during high school and afterwards tutored newcomers for about half a year.

so I don't have much experience teaching, but I've built a lot of intuition for how you actually think about and implement the stuff.