Pergunta de entrevista da empresa Amazon

Provide two algorithms: one to serialize a binary tree, the other to deserialize it.