Fügen Sie den Schlüssel in binärem Baum rekursiv ein
def insert(node, key, value):
if node == None:
node = key
if node < key:
insert(node.right, key, value)
else:
insert(node.left, key.value)
OR
def insert(node, key, value):
if node == None:
node = newNode(key,value)
elif node > key:
node.left = insert(node.left, key, value)
else:
node.right = insert(node.right, key, value)
return node
Sid Potti