AlgoFrames

Trace deserialize

Standard · Trace the algorithm · about 6 min

Rebuild the tree from "5,3,#,4,#,#,8,7,#,#,#". Before each step plays, click the node the next value hangs under.

Example 1

Input:

{"data":"5,3,#,4,#,#,8,7,#,#,#"}

Output:

[5,3,8,null,4,7]

Constraints

  • The trace uses the input shown.

Learn the idea first: Serialization and construction, a visual lesson.

More Serialization and construction problems