Issue checking if binary tree is also binary search tree
问题 I'm trying to solve this problem but I'm having some troubles: In a binary search tree (BST): The data value of every node in a node's left subtree is less than the data value of that node. The data value of every node in a node's right subtree is greater than the data value of that node. Given the root node: class Node { int data; Node left; Node right; } Determine if the binary tree is also a binary search tree I have this code: boolean check(Node root) { //node doesn't have any children if