1/9
Loading...
🔍BST Validation!
Let's check if this tree is a valid BST!
Loading...
Let's check if this tree is a valid BST!
A database index is stored as a Binary Search Tree (BST). Due to a system error, the index may be corrupted. Validate if the given tree is a valid BST.
[50, 30, 70, 20, 60, 65, 80]
false
60 is right child of 30 but greater than root(50), violating BST rule
[50, 30, 70, 20, 40, 65, 80]
true
All nodes satisfy BST property