non-recursive solution to inorderTraversal