From b2e683e8f9ce95313f467df4a07e1ecf2eb502a4 Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Wed, 28 Oct 2026 13:45:05 +0800 Subject: [PATCH] =?UTF-8?q?Update=2032.3=20=E6=8C=89=E4=B9=8B=E5=AD=97?= =?UTF-8?q?=E5=BD=A2=E9=A1=BA=E5=BA=8F=E6=89=93=E5=8D=B0=E4=BA=8C=E5=8F=89?= =?UTF-8?q?=E6=A0=91.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。 --- notes/32.3 按之字形顺序打印二叉树.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/notes/32.3 按之字形顺序打印二叉树.md b/notes/32.3 按之字形顺序打印二叉树.md index 640caaad..a38860db 100644 --- a/notes/32.3 按之字形顺序打印二叉树.md +++ b/notes/32.3 按之字形顺序打印二叉树.md @@ -1,6 +1,6 @@ # 32.3 按之字形顺序打印二叉树 -[NowCoder](https://www.nowcoder.com/practice/91b69814117f4e8097390d107d2efbe0?tpId=13&tqId=11212&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github) +[Leetcode](https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-iii-lcof/) ## 题目描述 @@ -9,13 +9,13 @@ ## 解题思路 ```java -public ArrayList> Print(TreeNode pRoot) { - ArrayList> ret = new ArrayList<>(); +public List> decorateRecord(TreeNode root) { + List> ret = new ArrayList<>(); Queue queue = new LinkedList<>(); - queue.add(pRoot); + queue.add(root); boolean reverse = false; while (!queue.isEmpty()) { - ArrayList list = new ArrayList<>(); + List list = new ArrayList<>(); int cnt = queue.size(); while (cnt-- > 0) { TreeNode node = queue.poll();