โ† Amazon questions

Distance Between Two Keys in Binary Tree

Filed under Amazon

Given a binary tree and two unique keys present in the tree, find the shortest distance between the two nodes. The distance is defined as the number of edges on the path connecting them.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.