Closed HSchmale16 closed 5 years ago
Why do you want to do this recursively? If you just do
auto it=tr.begin();
while(it!=tr.end()) {
/* do something with 'it' */
++it;
}
the iterator will take care of visiting all nodes. What precisely do you mean with 'I need a way to keep ... while popping stuff off'?
Hello I'm wondering if you could provide an example of using your tree.hh class in a recursive manner for doing a pre-order traversal? I need a way to keep existing scope around for the current list while popping stuff off.
I've looked all over the internet for a method to do so, but have not found an example with your class.