Deep Dive

Minimum Height Trees

310. Minimum Height Trees · Graph search · 62 of 78

1/4

Pick the best root

A1D4E2F1B1C1
In this lessonStep 1 of 4 · ← → keys
The question

Choose the root that makes a tree as short as possible. Peeling the leaves layer by layer leaves the 1 or 2 centre nodes, which are the answer.