中序遍历,匹配也使用中序遍历。 中序遍历非递归模板 # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def HasSubtree(self, pRoot1, pRoot2): stack = [] p = pRoot1 if pRoot2 == None: ...