← 返回 waymo 的题目列表Serialize and Deserialize Binary Tree with Character Values
类型:online_judge
Design an algorithm to serialize and deserialize a binary tree where each node holds a character value. Before serialization, Base64 encode each node's value. The serialized data structure should allow accurate reconstruction of the original binary tree.
Example Input
Tree structure:
a
/ \
b c
/
d
Expected Output
Return a serialized string.
Constraints
You may assume the input characters are limited to printable ASCII characters.
Base64 encoded string should not contain line breaks.
Data Size
The tree can have up to 10000 nodes.
Example
Input
a
/ \
b c
/
d