I am trying to learn as much as i can about tree's and their algorithm's. And it seems like i can't really learn how recursion works when i want to count something in binary tree. For example if i want to count nodes or leaves or something else. When i look in the solution i don't get it how counter increases and so on.I can remember solution for that particular problem but, when i get another problem which includes counting i dont know how to start my function.
Do you have any advice about my problem ? How did you learn different counting algorithms with recursion. I perfectly understand every iterative solution and i know how to use it .
Thanks in advance for your response