pbPassingBI
/

Explain and implement a serialization of a binary tree.

advanced
Answer

You can write serialization for leaf nodes, and then for parent nodes.

Recursive map: {value: [serialize(left), serialize(right)]}, where serialized leaf is null.

Related questions