Simplify the declarations of the Python code.

This commit is contained in:
krahets
2023-05-22 22:03:57 +08:00
parent 081b76d620
commit e196962d0a
27 changed files with 88 additions and 87 deletions

View File

@ -26,7 +26,7 @@ class BinarySearchTree:
return None
# 将数组中间节点作为根节点
mid: int = (start_index + end_index) // 2
mid = (start_index + end_index) // 2
root = TreeNode(nums[mid])
# 递归建立左子树和右子树
root.left = self.build_tree(