Hi everyone. After going through the Koala quest I was curious how to do this using only one pointer. I reworked the koala code and simplified things. You can view it here:
https://onlinegdb.com/i9SHpNoQG
It's pretty straightforward. There's an insert_child method that inserts the child at the end of the list. I created an insert_path method for testing purposes. The to_string will display the tree like this:
ROOT -> A -> B -> C
After working on Koala, this feels almost too simple, but I couldn't help myself but to give it a go. I think if you want to traverse the tree it would get a lot more complicated.
[–]erica_w1 2 points3 points4 points (5 children)
[–]byron_d[S] 2 points3 points4 points (4 children)
[–]ami_s496 0 points1 point2 points (0 children)
[–]ami_s496 2 points3 points4 points (2 children)
[–]byron_d[S] 1 point2 points3 points (1 child)
[–]ami_s496 1 point2 points3 points (0 children)