Dsa
Binary Search Tree
Easy
The K-th Filtered Reading
A scientific sensor stores temperature readings in a BST. You need to find the K-th smallest reading that is strictly greater than a threshold T. If there are fewer than K such readings, output -1.
Example:
Input: 10 5 15 3 7; 4 2
Output: 7
Explanation: Readings > 4 are {5, 7, 10, 15}. Sorted, the 2nd one is 7.
Key concepts
binary_search_treeinorder_traversalfiltering
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