Even with the new lesson and its patient teachings, I’m still totally bamboozled by recursion. I can sort of see what the code is attempting to do, but if you asked me to work out a problem from scratch with a blank page, I wouldn’t know where to start. Is recursion really something I need to know? Should I keep banging my head against walls of examples until I get it, or is it so rarely used in the real world that I can forget about it? It sounds like for just about everything I’d ever need, I could just use a ‘while’ loop, which I find infinitely easier to understand.
I ultimately want to program simple games. Is recursion used for such things? Like, ever?
If you’re a programmer and use recursion a lot, I’d love to know how and why!
Thanks!
for cp you will need recursion definitely for some advanced problems, but why not learn recursion?
you see that many basic and important algorithms need recursion,so it's necessary to learn.
Short Answer: Yes
Long Answer: The Idea of recursion is the core of so many non recursive algorithms and also helps you understand dp better. So Yes
It's blyatly beautiful, just that is enough guys
just look at 3 problems total permutations merge sort tower of hanoi In dp recursion idea is required but I learned DP before i learned recursion so it works.