Help me understand Inorder Traversal without using recursion
Start with the recursive algorithm (pseudocode) : traverse(node): if node != None do: traverse(node.left) print node.value traverse(node.right) endif This is a clear case of tail recursion, so you can easily turn it into a while-loop. traverse(node): while node != None do: traverse(node.left) print node.value node = node.right endwhile You’re left with a recursive call. What … Read more