I'm learning DP . Most of the code I've seen so far uses iterative DP. Is there anyone who uses Recursive DP?????
# | User | Rating |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 165 |
3 | Um_nik | 161 |
4 | atcoder_official | 160 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
I'm learning DP . Most of the code I've seen so far uses iterative DP. Is there anyone who uses Recursive DP?????
Name |
---|
Recursive dp usually has a lot of overhead time and memory-wise since recursion requires a call stack in memory and sometimes that exceeds the time or memory limit.
I use recursive DP when I am unsure in order of computing(or a lot of parameters). If it TLs then I rewrite it on iterative(if it is possible).
recursive dp sucks
I've seen many blog and comments saying iterative DP is better in many ways.... How do you get better at iterative DP ? I mean you need to be good at Recursive DP first R8?
Though I am not very good with dp, i find iterative dp easier than recursive dp (maybe coz i am not that good with backtracking)
recursive is more intuitive for me. Sometimes I'm forced to write iterative anyways though.
I use iterative DP & now it's a lot easier to think in iterative way.
As someone who codes Python too often, I'm immensely scared of whatever being recursive.
It's OK to use recursive DP when learning DP. recursive DPs can be easier to understand when first learning DP because the relationships between states are more obvious to see. I mostly used recursive DP until I became purple.
how did you transition? I mean it's quite difficult to transform recursive dp thinking to an iterative one. Are there any tricks you use to develop this skill or do you first solve recursively then transform the solution to an iterative one?
Idk I did suffer when I first tried to use iterative DP instead of recursive ones.
At some point iterative DP felt more comfortable than recursive DP.
it's just magic. you try to use iterative DP and someday when you look back you are only using iterative DP.