Dsa
Binary Search Tree
Easy
The Boutique Inventory Filter
A luxury boutique tracks its item prices in a Binary Search Tree (BST). A VIP customer wants to find the K-th most expensive item in the store that still falls within their budget (max_price). If the store has fewer than K items within that budget, output 'None'.
Example:
Input:
50 30 70 20 40 60 80
2 65
Output: 50
Explanation: Prices <= 65 are [20, 30, 40, 50, 60]. The 2nd largest is 50.
Key concepts
binary_search_treetraversalk-th element
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