Binary Tree - Reading From and Writing to a File
Hello. I was curious if anyone had any suggestions for writing a random binary tree(no specific height, unbalanced) to a file, that would make it extremely easy to read from a file? Currently, I have an extremely simply recursive function that writes it to a file in inorder. Of course, the problem with that is that I can't just simple read it back, or else the height of my tree could be altered. Should I write it to a file in two orders, and develop an algorithm that compares the orders to make the correct tree? Or is there something easier?