🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Binary Trees & BST Quiz: questions with answers

8 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. For this tree, what is the INORDER traversal? (type the values separated by spaces) (code)
  2. Q2. For the same tree, what is the PREORDER traversal?
  3. Q3. What is the maximum depth (counting nodes) of that tree?
  4. Q4. Which traversal of a Binary Search Tree visits values in sorted order?
  5. Q5. Which data structure does level-order (BFS) traversal use?
  6. Q6. Why is checking only left.val < node.val < right.val NOT enough to validate a BST?
  7. Q7. Which tree questions are usually solved with DFS returning a value from the children (postorder)? (select all that apply)
  8. Q8. What is the time complexity of visiting every node of a binary tree with n nodes?