Preorder Traversal of Subtree for N-ary Tree Queries
Filed under Nutanix
The question
Given an n-ary tree and queries asking for the preorder traversal of the subtree rooted at a specific node, pre-store the traversal for every node in a single tree traversal before processing the queries.
No write-up yet. Related questions below have one.
Related Nutanix questions
Collected from public candidate posts and coding forums. Updated Nov 2026.