Program to check if given tree is a BST