MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y3320n/dynamicprogramming/19t2xs72wy2xu/
r/ProgrammerHumor • u/nerdycatgamer • 2d ago
140 comments sorted by
View all comments
Show parent comment
1
Or just...
int fib(int n) { int a = 0; int b = 1; while (n-- > 0) { int c = a + b; a = b; b = c; } return a; }
-3 u/Illustrious-Ebb8815 1d ago That's dynamic programming. 2 u/SameThingOnADiffAcct 1d ago If there's not a 2D array, it's not dynamic programming, it's a loop. Fight me. -3 u/Illustrious-Ebb8815 1d ago What about the minimum coins problem? Also not DP? 4 u/SameThingOnADiffAcct 1d ago That has a 2D array, no?IDK its been like 15 years since school and enterprise don't do this stuff.
-3
That's dynamic programming.
2 u/SameThingOnADiffAcct 1d ago If there's not a 2D array, it's not dynamic programming, it's a loop. Fight me. -3 u/Illustrious-Ebb8815 1d ago What about the minimum coins problem? Also not DP? 4 u/SameThingOnADiffAcct 1d ago That has a 2D array, no?IDK its been like 15 years since school and enterprise don't do this stuff.
2
If there's not a 2D array, it's not dynamic programming, it's a loop. Fight me.
-3 u/Illustrious-Ebb8815 1d ago What about the minimum coins problem? Also not DP? 4 u/SameThingOnADiffAcct 1d ago That has a 2D array, no?IDK its been like 15 years since school and enterprise don't do this stuff.
What about the minimum coins problem? Also not DP?
4 u/SameThingOnADiffAcct 1d ago That has a 2D array, no?IDK its been like 15 years since school and enterprise don't do this stuff.
4
That has a 2D array, no?
IDK its been like 15 years since school and enterprise don't do this stuff.
View all comments
Show parent comment
1
u/s0litar1us 1d ago
Or just...