Search
⌘K

Leetcode 589. N-ary Tree Preorder Traversal

Given the root of an N-ary tree, produce its preorder traversal (visit each node before its children, left-to-right) as a list of values. Constraints: up to 10^4 nodes and height ≤1000; recursive is trivial, with an iterative stack-based solution as the common follow-up.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.