Back to Questions

Find the Root of N-ary Tree (Graph Traversal)

41.7K viewsAsked at Google
Easy

Question Explain

Given a list of nodes in an $N$-ary tree, where each node has a list of its children, find the root node. The root is the only node that is not a child of any other node.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question