refactor: Replace 结点 with 节点 (#452)

* Replace 结点 with 节点
Update the footnotes in the figures

* Update mindmap

* Reduce the size of the mindmap.png
This commit is contained in:
Yudong Jin
2023-04-09 04:32:17 +08:00
committed by GitHub
parent 3f4e32b2b0
commit 1c8b7ef559
395 changed files with 2056 additions and 2056 deletions

View File

@@ -9,17 +9,17 @@ const { printTree } = require("../modules/PrintUtil");
/* 层序遍历 */
function levelOrder(root) {
// 初始化队列,加入根
// 初始化队列,加入根
const queue = [root];
// 初始化一个列表,用于保存遍历序列
const list = [];
while (queue.length) {
let node = queue.shift(); // 队列出队
list.push(node.val); // 保存点值
list.push(node.val); // 保存点值
if (node.left)
queue.push(node.left); // 左子点入队
queue.push(node.left); // 左子点入队
if (node.right)
queue.push(node.right); // 右子点入队
queue.push(node.right); // 右子点入队
}
return list;
@@ -34,4 +34,4 @@ printTree(root);
/* 层序遍历 */
const list = levelOrder(root);
console.log("\n层序遍历的点打印序列 = " + list);
console.log("\n层序遍历的点打印序列 = " + list);