From 44a63998b5666c6cf5c04297478bb403464a5e5b 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.2=20=E6=8A=8A=E4=BA=8C=E5=8F=89?= =?UTF-8?q?=E6=A0=91=E6=89=93=E5=8D=B0=E6=88=90=E5=A4=9A=E8=A1=8C.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。 --- notes/32.2 把二叉树打印成多行.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/notes/32.2 把二叉树打印成多行.md b/notes/32.2 把二叉树打印成多行.md index 2366963c..ca851a1e 100644 --- a/notes/32.2 把二叉树打印成多行.md +++ b/notes/32.2 把二叉树打印成多行.md @@ -1,6 +1,6 @@ # 32.2 把二叉树打印成多行 -[NowCoder](https://www.nowcoder.com/practice/445c44d982d04483b04a54f298796288?tpId=13&tqId=11213&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-ii-lcof/) ## 题目描述 @@ -9,12 +9,12 @@ ## 解题思路 ```java -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); while (!queue.isEmpty()) { - ArrayList list = new ArrayList<>(); + List list = new ArrayList<>(); int cnt = queue.size(); while (cnt-- > 0) { TreeNode node = queue.poll();