← Google questions

Find root of an acyclic undirected graph to make a valid binary tree

Filed under Google

Given an acyclic undirected graph where each node has at most 3 neighbors, find a root node such that rooting the graph at this node transforms it into a valid binary tree (where every node has at…

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 Google questions

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