```
class Solution(object):
def isValidBST(self, root):
stack, inorder = [], []
while root:
stack.append(root)
root = root.left
while stack:
top = stack.pop()
inorder.append(top.val)
tmp = top.right
while tmp:
stack.append(tmp)
tmp = tmp.left
for i in xrange(1, len(inorder)):
if inorder[i] <= inorder[i - 1]:
return False
return True
```