Page 275 - Concise Encyclopedia of Robotics
P. 275
Recursion
with the intended result, but in recursion, there is always a reason for it.
All the subarguments must eventually be brought out and put to some
use in the main argument.
Computers are ideally suited for recursive arguments.The subarguments
can be done and the results put into memory. Humans get confused
when there are too many sidetracks; not so with computers. They will do
precisely what they are programmed to do, and they do not get distracted,
no matter how many sidetracks there are.
In a complicated recursive argument, the sidetracks can be backed up
one on top of another, like airplanes in a holding pattern waiting to
land at a large airport. The subarguments are held in pushdown stacks, or
first-in/last-out memory registers. The sidetracked results are pulled out
of the stacks when needed. The illustration shows a recursive argument
with several pushdown stacks.
Hangups
If a computer uses recursive logic and gets sidetracked too much, it might
lose sight of the final objective, or go around and around in logical circles.
When this happens in a computer program, it is called an endless loop or
an infinite loop. This is makes it impossible to solve any problem.
Start Finish
Recursion