Encode Decode
Encode and Decode Strings
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings.
Please implement encode and decode
Use escape character ":" to node "spliter"
Use "+" as spliter
297. Serialize and Deserialize Binary Tree
Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back from the file to reconstruct the exact same binary tree is 'deserialization'.
Pre-order traverse and use queue to store nodes
Use "#" as null
Use "," as spliter
Last updated
Was this helpful?