🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Binary Search Tree Operations: all 15 questions

Quiz: Binary Search Tree Operations · Question 14 of 15

What is a correct way to check that a binary tree is a valid BST?

What is a correct way to check that a binary tree is a valid BST?

  1. A.Check only that each left child < its parent < each right child
  2. B.Check that the tree is balanced
  3. C.Pass an allowed (low, high) range down the tree, or check that the inorder traversal is strictly increasing
  4. D.Check that the root is the middle value
Answer & explanation

Correct answer: Pass an allowed (low, high) range down the tree, or check that the inorder traversal is strictly increasing

A node deep in the left subtree must be smaller than every ancestor it sits to the left of, not just its parent.

Can you get the rest right without peeking?

Take the timed Quiz: Binary Search Tree Operations quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →