From db5ca936b615c365793f893c5c810de9ef27bbb9 Mon Sep 17 00:00:00 2001 From: reanon <793584285@qq.com> Date: Sat, 26 Nov 2022 13:24:35 +0800 Subject: [PATCH] feat(tree): add binary tree in golang --- codes/go/chapter_tree/binary_tree_test.go | 2 +- docs/chapter_tree/binary_tree.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/go/chapter_tree/binary_tree_test.go b/codes/go/chapter_tree/binary_tree_test.go index ee77edc..2c05076 100644 --- a/codes/go/chapter_tree/binary_tree_test.go +++ b/codes/go/chapter_tree/binary_tree_test.go @@ -11,7 +11,7 @@ import ( func TestBinaryTree(t *testing.T) { /* 初始化二叉树 */ - // 初始化节点 + // 初始化结点 n1 := NewTreeNode(1) n2 := NewTreeNode(2) n3 := NewTreeNode(3) diff --git a/docs/chapter_tree/binary_tree.md b/docs/chapter_tree/binary_tree.md index 07a9a64..a53507d 100644 --- a/docs/chapter_tree/binary_tree.md +++ b/docs/chapter_tree/binary_tree.md @@ -24,7 +24,7 @@ comments: true
Fig. 子结点与子树
-需要注意,父结点、子结点、子树是可以向下递推的。例如,如果将上图的「结点 2」看作父结点,那么其左子节点和右子结点分别为「结点 4」和「结点 5」,左子树和右子树分别为「结点 4 以下的树」和「结点 5 以下的树」。 +需要注意,父结点、子结点、子树是可以向下递推的。例如,如果将上图的「结点 2」看作父结点,那么其左子结点和右子结点分别为「结点 4」和「结点 5」,左子树和右子树分别为「结点 4 以下的树」和「结点 5 以下的树」。 ## 二叉树常见术语