def isSameTree(self, p, q):
        """
        dfs
        :param p: TreeNode
        :param q: TreeNode
        :return: boolean
        """

        # trivial
        if not p and not q:
            return True

        # dfs
        try:
            if p.val==q.val and self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right):
                return True
        except __HOLE__:
            return False

        return False
dataset/ETHPy150Open algorhythms/LeetCode/100 Same Tree.py/Solution.isSameTree