Skip to content

Commit

Permalink
Update 144.binary-tree-preorder-traversal.md
Browse files Browse the repository at this point in the history
  • Loading branch information
azl397985856 authored Jun 28, 2020
1 parent babcc74 commit 06974e9
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions problems/144.binary-tree-preorder-traversal.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Follow up: Recursive solution is trivial, could you do it iteratively?
前序遍历是`根左右`的顺序,注意是``开始,那么就很简单。直接先将根节点入栈,然后
看有没有右节点,有则入栈,再看有没有左节点,有则入栈。 然后出栈一个元素,重复即可。

> 其他树的非递归遍历课没这么简单
> 其他树的非递归遍历可没这么简单
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gg7v5hztd2j30zu0ntwiu.jpg)

Expand Down Expand Up @@ -62,44 +62,6 @@ Follow up: Recursive solution is trivial, could you do it iteratively?
JavaScript Code:

```js
/*
* @lc app=leetcode id=144 lang=javascript
*
* [144] Binary Tree Preorder Traversal
*
* https://leetcode.com/problems/binary-tree-preorder-traversal/description/
*
* algorithms
* Medium (50.36%)
* Total Accepted: 314K
* Total Submissions: 621.2K
* Testcase Example: '[1,null,2,3]'
*
* Given a binary tree, return the preorder traversal of its nodes' values.
*
* Example:
*
*
* Input: [1,null,2,3]
* ⁠ 1
* ⁠ \
* ⁠ 2
* ⁠ /
* ⁠ 3
*
* Output: [1,2,3]
*
*
* Follow up: Recursive solution is trivial, could you do it iteratively?
*
*/
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @return {number[]}
Expand Down

0 comments on commit 06974e9

Please sign in to comment.