Depth of a key in a BST
You insert the keys in that order into an initially empty binary search tree (each key walks down from the root, going left if smaller and right if larger, until it hits an empty spot). At what depth does key end up? (The root is at depth .)
Show hints (2)+
- Insert in the given order; each key walks left/right until an empty slot.
- Trace 's path from the root: .
Answer
Reveal answer →Final answer
3
Create a free account to see the full worked solution and track your progress.
Interview format: Market Maker, Trading Aptitude Tests