Amazon Interview Question

Given a tree, write a function to print that tree. Follow-up write a function to recreate that tree from its printed form.