class Node: #建立二叉树 def __init__(self,value=None,left=None,right=None): self.value=value self.left=left #左子树 self.right=right #右子树 def preTraverse(root): #前序遍历 if root==None: return print(root.value,end="") __________ __________ def midTraverse(root): #中序遍历 if root==None: return __________ __________ __________ def afterTraverse(root): #后序遍历 if root==None: return __________ __________ __________ root=Node('D',Node('B',Node('A'),Node('C')),Node('E',right=Node('G',Node('F')))) preTraverse(root) print() midTraverse(root) print() afterTraverse(root)