Several bug fixes.

This commit is contained in:
krahets
2023-09-20 01:53:44 +08:00
parent 53d91db10d
commit 8effa58a59
7 changed files with 6 additions and 9 deletions

View File

@@ -26,8 +26,8 @@ AVL 树既是二叉搜索树也是平衡二叉树,同时满足这两类二叉
class TreeNode:
"""AVL 树节点类"""
def __init__(self, val: int):
self.val: int = val # 节点值
self.height: int = 0 # 节点高度
self.val: int = val # 节点值
self.height: int = 0 # 节点高度
self.left: TreeNode | None = None # 左子节点引用
self.right: TreeNode | None = None # 右子节点引用
```

View File

@@ -8,7 +8,7 @@
class TreeNode:
"""二叉树节点类"""
def __init__(self, val: int):
self.val: int = val # 节点值
self.val: int = val # 节点值
self.left: TreeNode | None = None # 左子节点引用
self.right: TreeNode | None = None # 右子节点引用
```