boolean isBST(Node root) { if (root == null) { return true; } return (isBST(root.left) && (isBST(root.

right) && (root.left == null || root .left.data <= root.data) && (root.right == null || root.right.data > root.data)) ; }

Sign up to vote on this title
UsefulNot useful