Updated the code for inorder traversal without recursion