Leetcode 7 and 8/non-recursive preorder, inorder,postorder traversal