Pregunta de entrevista de Amazon

Write code to serialize and then deserialize a tree.