Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree [1,null,2,3]
,
1 \ 2 / 3
return [1,3,2]
.
Note: Recursive solution is trivial, could you do it iteratively?
题目大意:输出给定二叉树中序遍历的结果。
解题思路:二叉树中序遍历的顺序是先遍历左子树,然后遍历根节点,最后遍历右子树。题目说递归遍历的写法太常见了,那我们就写非递归的。根据中序遍历的