Question DSA-BST-167
HardHow can you find the k-th smallest element of a BST in O(h) time?
- A.
Store subtree sizes in each node and walk down comparing k with the left size
- B.
Use a heap
- C.
Sign up free to see the answer and a step-by-step explanation.