class Node:
def __init__(self,key):
self.left=None
self.right=None
self.val=key
def insert(root,key):
if root is None:
root=Node(key)
else:
if root.val < key:
insert(root.right, key)
else:
insert(root.left, key)
def inorder(root):
if root:
inorder(root.right)
print root.val
inorder(root.left)
root=None
d=input()
while(d!=-1):
insert(root,d)
d=input()
inorder(root)
我无法按顺序打印上面的树元素.....代码出了什么问题....任何人都可以解释一下吗?