I need an algorithm to solve preorder traversal of a binary tree.Please provide me the algo to traverse a tree preorderly without using recursive call
Asked
Active
Viewed 80 times
0
-
1Possible duplicate of [Way to go from recursion to iteration](https://stackoverflow.com/questions/159590/way-to-go-from-recursion-to-iteration) – Raymond Nijland Jul 06 '19 at 16:28
-
1Have you tried anything? [Googling the problem even?](https://www.google.com/search?q=preorder+tree+traversal+without+recursion) – phflack Jul 06 '19 at 16:31
-
You need to use a stack, either system or utility, in order to do the task and it is inherently a recursive process and not constant space. Thus not like the Fibonacci sequence where you can calculate the value in constant space. – Sylwester Jul 06 '19 at 19:09