Design a serialization and deserialization algorithm for an N-ary tree.
Design an algorithm to serialize and deserialize an N-ary tree. In an N-ary tree, each node can have any number of children.
Serialize: Convert the tree to a string representation. Deserialize: Convert the string back to the original tree.