In article <43***************@virginia.edu>,
Julian V. Noble <jv*@virginia.edu> wrote:
According to Kruse, "Data Structures & Program Design" any recursive
algorithm can be converted to a non-recursive one, by theorem.
Though true, this is not generally useful, since you will typically
have to use something equivalent to a stack.
In the case of tree-traversal algorithms, it is sometimes possible to
use the tree itself instead of a stack, using "pointer reversal"
tricks. In years gone by garbage collectors often used this trick
(and perhaps they still do).
-- Richard