deadshot_24's blog

By deadshot_24, history, 5 months ago, In English

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!

  • Vote: I like it
  • +2
  • Vote: I do not like it

»
5 months ago, # |
  Vote: I like it +13 Vote: I do not like it

for cp you will need recursion definitely for some advanced problems, but why not learn recursion?

»
5 months ago, # |
Rev. 3   Vote: I like it +9 Vote: I do not like it

you see that many basic and important algorithms need recursion,so it's necessary to learn.

»
5 months ago, # |
  Vote: I like it +1 Vote: I do not like it

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

»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It's blyatly beautiful, just that is enough guys

»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.