Dsa
Binary Search Tree
Easy
Count BST Nodes In Range
Given a binary search tree (BST) and a range [low, high], write a function to count the number of nodes that fall within the given range. The BST is provided as a level-order traversal format. Print the count of nodes within the range.
Example Input:
10
5 15
3 7 12 20
null null null null null null
Output:
3
Key concepts
binary_search_treerange_query
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now