Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes’ values.
Example:
1 | Input: [1,null,2,3] |
Follow up: Recursive solution is trivial, could you do it iteratively?
思路:二叉树的中序遍历,最简单的办法就是经典的递归算法。
1 | /** |
但是题目中不让用递归,希望用迭代解决