Amazon Interview Question

write a function that prints out the strings in a binary tree and then recreate the binary tree from the string.