Okay so I am in a Data Structures class and am working on Binary Trees now so I figured I do a little project on the side to experiment.
So I have a frame pop up when the program starts and it has a bunch of information to enter in. When you are done you hit the "SAVE" button and it generates a "Person" and adds the person to a Tree depending on their ID number. So the tree is ordered and easy to search and all that stuff and the tree works great. Only issue is when you close the program all the people disappear from the tree and when you go to search for a "Person" next time you open the program the tree is empty.
How would I go about saving everything so that when I open the program again the tree is still there?
Note: I have a "Storage.java" that contains: add(), remove(), search(), getRoot(); and a private variable called root that is of type TNode (this contains: data, rightTree, and leftTree)