Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Validate Binary Search Tree
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given the root of a binary tree, determine if it is a valid binary search tree.
Sample Input:
[2,1,3]
Sample Output:
true
Hints
Hint 1
Use recursive validation with min/max bounds
Hint 2
Left subtree must be < node value, right subtree must be > node value
Hint 3
Update bounds as you traverse down the tree
Code Editor
Reset
Run
Save
Loading...