I'm doing a homework for university. Is the first time I use tree as a data structure and I don't understand how to implement it in Java.
I have to read from a .txt file a string like this
( 1 ( 2 ( 5 ( 13 ) 6 7 ) 3 ( 8 9 ) 4 ( 10 11 12 ) ) )
where the round brackets are delimiter for a level of a tree representing root and sons in this way --> (root (soon1 soon2) )
the structure of this tree is this:
1
2 3 4
5 6 7 8 9 10 11 12
13
I've already implemented a method to read the .txt file but I don't know how to store the value in different levels and marking them as root or child.