mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-14 11:36:08 +08:00
Optimize arrToTree function
in java, cpp, py, go, js, ts.
This commit is contained in:
@ -138,7 +138,7 @@ class BinarySearchTree:
|
||||
""" Driver Code """
|
||||
if __name__ == "__main__":
|
||||
# 初始化二叉搜索树
|
||||
nums = list(range(1, 16))
|
||||
nums = list(range(1, 16)) # [1, 2, ..., 15]
|
||||
bst = BinarySearchTree(nums=nums)
|
||||
print("\n初始化的二叉树为\n")
|
||||
print_tree(bst.root)
|
||||
|
Reference in New Issue
Block a user