Create check if a tree is BST or not

Check if a given tree is a BST or not. BST is a tree such that any of the children on left branch is smaller than the parent element and every element on the right side of the branch is larger than the parent element.