Similar questions 4 more →
Binary Search & Balanced Trees


Answer & solution
Answer: Impossible. (no official key was published)
A search path obeys every ancestor constraint, not merely the immediately preceding comparison. Maintain an open interval of permissible keys, initially (−∞,+∞). When a probe is below 43, searching right raises the lower bound to that probe. When a probe is above 43, searching left lowers the upper bound.
After 17, every later probe must lie in (17,+∞).
After 77, every later probe must lie in (17,77).
After 27, every later probe must lie in (27,77).
After 66, every later probe must lie in (27,66).
Probe 18 violates the inherited interval (27,66); the sequence is impossible.
The violated bound comes from an earlier ancestor. A later comparison cannot discard it: every node subsequently visited remains inside that ancestor’s chosen subtree. No choice of unvisited nodes can repair this path.