LeetCode Week 6

144. Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes’ values. solutions: 本题意是要求不使用递归而是用迭代的方法输出一颗二叉树的前序遍历。 对于前序遍历,先访问根节点,再访问左子树,最后访问右子树。 先访问root节点,并将它和它的v
相关文章
相关标签/搜索