Validate Binary Search Tree
Try to solve the Validate Binary Search Tree problem.
We'll cover the following
Statement
Given the root of a binary tree, check whether it is a valid binary search tree (BST).
A binary tree is a valid BST if for every node:
-
The value of the node is greater than or equal to the value of its left node.
-
The value of the node is less than or equal to the value of its right node.
-
Both the left and right subtrees are valid BSTs.
Constraints:
-
Node.data
-
The tree contains nodes in the range .
Examples
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy