TreesExplained
Serialize and Deserialize Binary Tree
Write the tree with null markers, then rebuild it from the text.
Time
O(n)
Extra space
O(n)
Use it for
Saving and sending trees.
Write the tree with null markers, then rebuild it from the text.
Time
O(n)
Extra space
O(n)
Use it for
Saving and sending trees.