Check a Search Tree
Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.
The problem
- medium
- Pro
Given a binary tree, decide whether it's a valid binary search tree: every node's value must be greater than all values in its left subtree and less than all values in its right subtree. Explain why only comparing each node with its children isn't enough, and how you'd check it properly.
Talk this problem through with an AI coach
This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.