Question DSA-BST-172
HardHow do you check that a binary tree is a valid BST?
- A.
Count the nodes
- B.
Pass down an allowed (low, high) range and check every node lies inside it
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Binary Search Trees question
How do you check that a binary tree is a valid BST?
Count the nodes
Pass down an allowed (low, high) range and check every node lies inside it
Sign up free to see the answer and a step-by-step explanation.
Check only that each left child is smaller than its parent
Check the root only