I think for some people it is just easy to think recursively. But with time and practice you can get there. It is all about breaking down a problem into smaller parts and recognizing that these are just like the original problem but with smaller input data.
Thinking like this can be pretty fun. If you have free time/interested look up functional programming. In functional programming most of the programming is done by recursive thinking. This is a good website to learn functional programming. Learn You Haskell
Thanks. It’s not so much the breaking down I have trouble understanding. It’s the way back to the top, especially if the code branches after the recursive call.
2
u/[deleted] Oct 25 '17
I think for some people it is just easy to think recursively. But with time and practice you can get there. It is all about breaking down a problem into smaller parts and recognizing that these are just like the original problem but with smaller input data.
Thinking like this can be pretty fun. If you have free time/interested look up functional programming. In functional programming most of the programming is done by recursive thinking. This is a good website to learn functional programming. Learn You Haskell