1. ## Recursion

Hey!
In abbreviation I know what's recursion and how it's working on computer, my question is I didn't understand the term of "Recursion is about traversing(assuming in binary tree)" can someone give me analogy of how recursion is really traversing?
traversing I think means calling all other sides and returning to the caller, so it's called traversing ....any analogy of real life about?!

sorry about that but to be more sensible to the term of recursion ! 2. I think you're over-thinking this. If you understand recursion, then say, you could write a recursive function to do something with a binary tree that would involve traversing the tree in some way. That's it. Don't over think. You shouldn't need an analogy when terms like "tree" and "traverse" are already metaphors. 3. In recursion, the first thing that I normally think about is the stopping condition(s).

Tim S. 4. Recursion is used for self-similar problems.

A sub-tree of a tree still looks like a tree.

factorial(N) is N*factorial(N-1)

As stahta01 says, you just need to figure out what the really simple step is.
For a tree, it's an empty tree.
For factorial, it's factorial(0). 5. Originally Posted by Salem What's the stopping condition? I kept following that link and didn't know when to stop!   Popular pages Recent additions binary, give, recursion, traversingassuming, tree 