Title: verify whether a binary tree binary sort tree
def isValidBST(root): inorder = inorder(root) return inorder == list(sorted(set(inorder))) def inorder(root): if root is None: return [] return inorder(root.left) + [root.val] +inorder(root.right)
Note:
Using preorder traversal of a binary tree, if the result is sorted, it indicates that the binary sort tree is a binary tree