参考:http://www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/ <pre name="code" class="plain">1. Initialize current as root 2. While current is not NULL If current does not have left child a) Print cu
Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1, null, 1,2,3 ] 1 2 / 3 Output: [1,2,3] Follow up: Recursive solution is trivial, could you do it iteratively? 思路 二叉树的前序遍历方法分为递归法和使用循环辅助栈的方法,递归方法我们在递归左右节点之前先将当