"Have an option that would write the contents of the tree to a file, inorder, then read it back in to balance the tree (use the algorithm in chapter 16). Remember that the algorithm works mainly with a full tree. A full tree has the number of nodes of 2h – 1. Try and get the tree to have that number. Then write and read the tree (count the dummy nodes). Remove the dummy nodes."
This is our homework question and I'm having trouble understanding how we would implement this. Even pseudocode or explanation would help for this