Search
⌘K

Leetcode 431. Encode N-ary Tree to Binary Tree

Design encode and decode functions that convert an N-ary tree to a binary tree and back, preserving node values and child order. The core challenge is representing an arbitrary number of children in binary form (commonly via the left-child/right-sibling mapping) so the transformation is reversible and efficient.


Question Timeline

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

Comments

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