previous |
start |
next
Thinking Recursively
- The algorithms for computing the triangle area,
the factorial function and the word permutations all work on the
same principle.
- When working on a complex input, first solve
the problem with a simpler input.
- Turn the simpler result into the result for the
more complex unit.
- One function calls another that works on an even simpler input
until one function's input is so simple that it can compute the results
without further help.
- What's important is that you can focus on
putting a solution together from the slightly simpler
problem.
previous |
start |
next