add binary_tree and avl_tree python code

This commit is contained in:
a16su
2022-12-20 15:52:00 +08:00
parent 2a1bb23990
commit 9eac1275f6
9 changed files with 967 additions and 22 deletions

View File

@ -9,7 +9,7 @@ import collections
class TreeNode:
"""Definition for a binary tree node
"""
def __init__(self, val=0, left=None, right=None):
def __init__(self, val=None, left=None, right=None):
self.val = val
self.left = left
self.right = right