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

@@ -10,7 +10,7 @@ var list = std.ArrayList(i32).init(std.heap.page_allocator);
// 前序遍历
fn preOrder(comptime T: type, root: ?*inc.TreeNode(T)) !void {
if (root == null) return;
// 访问优先级:根点 -> 左子树 -> 右子树
// 访问优先级:根点 -> 左子树 -> 右子树
try list.append(root.?.val);
try preOrder(T, root.?.left);
try preOrder(T, root.?.right);
@@ -19,7 +19,7 @@ fn preOrder(comptime T: type, root: ?*inc.TreeNode(T)) !void {
// 中序遍历
fn inOrder(comptime T: type, root: ?*inc.TreeNode(T)) !void {
if (root == null) return;
// 访问优先级:左子树 -> 根点 -> 右子树
// 访问优先级:左子树 -> 根点 -> 右子树
try inOrder(T, root.?.left);
try list.append(root.?.val);
try inOrder(T, root.?.right);
@@ -28,7 +28,7 @@ fn inOrder(comptime T: type, root: ?*inc.TreeNode(T)) !void {
// 后序遍历
fn postOrder(comptime T: type, root: ?*inc.TreeNode(T)) !void {
if (root == null) return;
// 访问优先级:左子树 -> 右子树 -> 根
// 访问优先级:左子树 -> 右子树 -> 根
try postOrder(T, root.?.left);
try postOrder(T, root.?.right);
try list.append(root.?.val);
@@ -51,19 +51,19 @@ pub fn main() !void {
// 前序遍历
list.clearRetainingCapacity();
try preOrder(i32, root);
std.debug.print("\n前序遍历的点打印序列 = ", .{});
std.debug.print("\n前序遍历的点打印序列 = ", .{});
inc.PrintUtil.printList(i32, list);
// 中序遍历
list.clearRetainingCapacity();
try inOrder(i32, root);
std.debug.print("\n中序遍历的点打印序列 = ", .{});
std.debug.print("\n中序遍历的点打印序列 = ", .{});
inc.PrintUtil.printList(i32, list);
// 后序遍历
list.clearRetainingCapacity();
try postOrder(i32, root);
std.debug.print("\n后续遍历的点打印序列 = ", .{});
std.debug.print("\n后续遍历的点打印序列 = ", .{});
inc.PrintUtil.printList(i32, list);
_ = try std.io.getStdIn().reader().readByte();