Merge pull request #183 from guowei-gong/binary_tree

docs(binary_tree): fix comment style and punctuation
This commit is contained in:
Yudong Jin 2022-12-29 00:50:53 +08:00 committed by GitHub
commit 047e15e8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,13 +44,13 @@ comments: true
=== "Go" === "Go"
```go title="" ```go title=""
// 链表结点类 /* 链表结点类 */
type TreeNode struct { type TreeNode struct {
Val int Val int
Left *TreeNode Left *TreeNode
Right *TreeNode Right *TreeNode
} }
// 结点初始化方法 /* 结点初始化方法 */
func NewTreeNode(v int) *TreeNode { func NewTreeNode(v int) *TreeNode {
return &TreeNode{ return &TreeNode{
Left: nil, Left: nil,
@ -121,7 +121,7 @@ comments: true
- 「根结点 Root Node」二叉树最顶层的结点其没有父结点 - 「根结点 Root Node」二叉树最顶层的结点其没有父结点
- 「叶结点 Leaf Node」没有子结点的结点其两个指针都指向 $\text{null}$ - 「叶结点 Leaf Node」没有子结点的结点其两个指针都指向 $\text{null}$
- 结点所处「层 Level」从顶置底依次增加根结点所处层为 1 - 结点所处「层 Level」从顶置底依次增加根结点所处层为 1
- 结点「度 Degree」结点的子结点数量,二叉树中度的范围是 0, 1, 2 - 结点「度 Degree」结点的子结点数量。二叉树中,度的范围是 0, 1, 2
- 「边 Edge」连接两个结点的边即结点指针 - 「边 Edge」连接两个结点的边即结点指针
- 二叉树「高度」:二叉树中根结点到最远叶结点走过边的数量; - 二叉树「高度」:二叉树中根结点到最远叶结点走过边的数量;
- 结点「深度 Depth」 :根结点到该结点走过边的数量; - 结点「深度 Depth」 :根结点到该结点走过边的数量;