in reply to Binary tree without recurssion
Why do you want to avoid recursion? Performance reasons? Spec from instructor? Usually when people ask this sort of thing, it's an XY Problem.
As Anonymous Monk cheerfully points out, recursion is just iteration. This is usually most easily done with Loop Control. If your tree isn't doubly linked, you'll probably also want to maintain a stack for traversing upwards. Recursion is usually taught first because it is more intuitive. If you share your implemented binary tree (wrapped in code tags), I'd be happy to show how to adapt your algorithm.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|