Hello. I've implemented a simple tree structure for a computer vision project. It's the first time I've done anything serious in c++ so I would very much appreciate any kind of feedback you can think of :). Especially I would like to know if there is a simpler way to achieve the same thing (perhaps with in-built functions - or without using vectors) and if I'm doing anything that is bad form.
The idea is that the the constructor of tree_node takes in and recursively pareses a text file to construct a tree. Each line in the txt file specifies the parent node followed by its children nodes (in depth-first order). So for example if "treefile.txt" contains the following:
0 1 2
1 11 12
2 21 22 23
you should get tree where the root node "0" has two children "1" and "2" that each have 2 ("11","12") and 3 ("21","22","23") children respectively. The output of walk_depth_first() would then be:
0
1
11
12
2
21
22
23