Unify the comment style of python codes

This commit is contained in:
krahets
2023-04-09 05:30:02 +08:00
parent 5ddcb60825
commit 10e2180013
53 changed files with 109 additions and 106 deletions

View File

@@ -52,8 +52,8 @@ G. M. Adelson-Velsky 和 E. M. Landis 在其 1962 年发表的论文 "An algorit
=== "Python"
```python title=""
""" AVL 树节点类 """
class TreeNode:
"""AVL 树节点类"""
def __init__(self, val: int):
self.val: int = val # 节点值
self.height: int = 0 # 节点高度

View File

@@ -29,8 +29,8 @@
=== "Python"
```python title=""
""" 二叉树节点类 """
class TreeNode:
"""二叉树节点类"""
def __init__(self, val: int):
self.val: int = val # 节点值
self.left: Optional[TreeNode] = None # 左子节点指针
@@ -188,7 +188,7 @@
=== "Python"
```python title="binary_tree.py"
""" 初始化二叉树 """
# 初始化二叉树
# 初始化节点
n1 = TreeNode(val=1)
n2 = TreeNode(val=2)
@@ -328,7 +328,7 @@
=== "Python"
```python title="binary_tree.py"
""" 插入与删除节点 """
# 插入与删除节点
p = TreeNode(0)
# 在 n1 -> n2 中间插入节点 P
n1.left = p
@@ -502,7 +502,7 @@
=== "Python"
```python title=""
""" 二叉树的数组表示 """
# 二叉树的数组表示
# 直接使用 None 来表示空位
tree = [1, 2, 3, 4, None, 6, 7, 8, 9, None, None, 12, None, None, 15]
```