Binary Search Tree

Check if a tree is a BST or not 

# This is an input class. Do not edit.
class BST:
    def __init__(self, value):
        self.value = value
        self.left = None
        self.right = None

def validateBst(tree):
	return validateBsthelper(tree,float('-inf'),float('inf'))
	
def validateBsthelper(tree,minn,maxx):
    # Write your code here.
    if tree is None:
		return True
	if tree.value<minn or tree.value>=maxx:
		return False
	l=validateBsthelper(tree.left,minn,tree.value)
	r=validateBsthelper(tree.right,tree.value,maxx)
	return l and r