From fec8e0882a771ea5866e0611c01874d6850654e6 Mon Sep 17 00:00:00 2001 From: Steve2020 <841532108@qq.com> Date: Mon, 24 Jan 2022 20:27:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=88=E4=BA=8C=E5=8F=89?= =?UTF-8?q?=E6=A0=91=E7=9A=84=E9=80=92=E5=BD=92=E9=81=8D=E5=8E=86.md?= =?UTF-8?q?=EF=BC=89=EF=BC=9A=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?js=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/二叉树的递归遍历.md | 34 ---------------------------- 1 file changed, 34 deletions(-) diff --git a/problems/二叉树的递归遍历.md b/problems/二叉树的递归遍历.md index ba13fc74..c481fd11 100644 --- a/problems/二叉树的递归遍历.md +++ b/problems/二叉树的递归遍历.md @@ -270,40 +270,6 @@ func postorderTraversal(root *TreeNode) (res []int) { } ``` -javaScript: - -```js - -前序遍历: - -var preorderTraversal = function(root, res = []) { - if (!root) return res; - res.push(root.val); - preorderTraversal(root.left, res) - preorderTraversal(root.right, res) - return res; -}; - -中序遍历: - -var inorderTraversal = function(root, res = []) { - if (!root) return res; - inorderTraversal(root.left, res); - res.push(root.val); - inorderTraversal(root.right, res); - return res; -}; - -后序遍历: - -var postorderTraversal = function(root, res = []) { - if (!root) return res; - postorderTraversal(root.left, res); - postorderTraversal(root.right, res); - res.push(root.val); - return res; -}; -``` Javascript版本: 前序遍历: