parameters: (self, root)
return_statement: return True
docstring: :type root: TreeNode
          :rtype: bool
docstring_summary: :type root: TreeNode
          :rtype: bool
docstring_tokens: : type root : TreeNode : rtype : bool
function: def isValidBST(self, root):
          """
          :type root: TreeNode
          :rtype: bool
          """
          if not root:
              return True
  
          pre = None
          stack = list()
          while root or stack:
              if root:
                  stack.append(root)
                  root = root.left
              else:
                  root = stack.pop()
                  if pre and root.val <= pre.val:
                          return False
                  
                  pre = root
                  root = root.right
  
          return True
function_tokens: def isValidBST ( self , root ) : if not root : return True pre = None stack = list ( ) while root or stack : if root : stack . append ( root ) root = root . left else : root = stack . pop ( ) if pre and root . val <= pre . val : return False pre = root root = root . right return True