How to develop recursive thinking to a level at which one could easily solve problems like outputting only those elements of a binary tree that are visible from the top, and it is easy to write other recursive algorithms, for example, dynamic programming?
Googling is either just nonsense, or a primitive explanation about "Karach recursion, this kada function calls itself)))". Less common is information about how the stack is used when recursive procedures are used, but this knowledge does not increase the ability to write recursive algorithms.
Solutions of several tasks for recursion with a hackerran came to me intuitively, and I want to develop the ability to solve an arbitrary task for recursion consciously. How to achieve this?
Examples of the type:
def f(n): if(n == 0) return print n f(n - 1) primitive, too easy, and their understanding does not develop the ability to solve a given task recursively.