| Topic | Difficulty | Companies |
|---|---|---|
| Binary Search Tree | MEDIUM | Amazon |
Given a binary search tree, write a program to find the kth largest element in it.
Problem Note
Example
Input: k = 3 and fllowing is the tree
10
/ \
4 20
/ / \
2 15 40
Output: 15
Explanation: 15 is the 3rd largest element in the BST.