You are on page 1of 1

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)) ; }

You might also like