Given a node, validate the binary search tree, ensuring that every node’s left hand child is less than the parent node’s value, and that every node’s right hand child is greater than the parent
Requirements that are always true for any given node in Binary Search Tree
:
Challenge | Solution |
val tree = Node(2)
tree.insert(10)
isValidSearchBinaryTree(tree) // true