Блог пользователя deadshot_24

Автор deadshot_24, история, 4 месяца назад, По-английски

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!

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
4 месяца назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

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

»
4 месяца назад, # |
Rev. 3   Проголосовать: нравится +9 Проголосовать: не нравится

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

»
4 месяца назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It's blyatly beautiful, just that is enough guys

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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.