fine tune

This commit is contained in:
krahets
2023-09-17 01:13:15 +08:00
parent b2246e11a7
commit 9f59c572b5
32 changed files with 44 additions and 44 deletions

View File

@ -35,7 +35,7 @@ class TreeNode:
def list_to_tree_dfs(arr: list[int], i: int) -> TreeNode | None:
"""将列表反序列化为二叉树:递归"""
# 如果索引超出数组长度,或者对应的元素为 None返回 None
# 如果索引超出数组长度,或者对应的元素为 None ,则返回 None
if i < 0 or i >= len(arr) or arr[i] is None:
return None
# 构建当前节点