':type s: TreeNode
:type t: TreeNode
:rtype: bool'

def isSubtree(self, s, t):

    def isSame(x, y):
        if ((not x) and (not y)):
            return True
        if ((not x) or (not y)):
            return False
        return ((x.val == y.val) and isSame(x.left, y.left) and isSame(x.right, y.right))
    def preOrderTraverse(s, t):
        return ((s != None) and (isSame(s, t) or preOrderTraverse(s.left, t) or preOrderTraverse(s.right, t)))
    return preOrderTraverse(s, t)
