← Amazon questions

Create tree with minimum depth from graph

Filed under Amazon

Given an undirected graph, find a spanning tree rooted at a given node such that the height (maximum depth from the root) of the tree is minimized. This is equivalent to finding a breadth-first search…

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.