How to read a txt file and print it as a tree form? Here is the text
Fantastic news! We've Found the answer you've been seeking!
Question:
How to read a txt file and print it as a tree form?
Here is the text :
ABC
1Central
11Mendy
111-Irving
112-Grey
113-LDS
2Hill
21Tabler
211-Tosc
212-TAC
213-Hand
22Roth
3West
31WestApartments
32-GLS Center
4-BasementClub
Read and print it as a tree form:
->ABC //cursor is automatically at root
+Central
+Mendy
-Irving
-Grey
-LDS
+Hill
+Tabler
-Tosc
-TAC
-Hand
+Roth
+West
+WestApartments
-GLS Center
-BasementClub
public static NetworkTree readFromFile(String filename)
Generates the NetworkTree based on the file name that is passed in.
public static void writeToFile(NetworkTree tree, String filename)
Generates a text file that reflects the structure of the NetworkTree.
The format of the tree of the file should match the format of the input file.
Related Book For
Posted Date: