Dsa
Binary Search Tree
Medium
Find Range in BST
Given a binary search tree and a range [low, high], find all the values that fall within this range. The input starts with an integer n, the number of nodes followed by n lines each containing a single integer (the value of the node). Then, two integers denoting the range (low and high). Output the values in sorted order, one per line. If no values fall within the range, output "No values in range.".
Example Input:
5
10
5
15
3
7
5 12
Example Output:
5
7
10
Key concepts
binary_search_treerange_querysearch
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