EDIT: I've come across an error. Once i insert the new node into the tree and use a search function to see if it has been inserted it works and then my insert function ends. However when i check in main to see if i still have that node attached no node is attached. It simply says theres no list.
Is it my insert function failing? Or is it my find function failing? Any help would be appreciated. I'm not sure what happen to my last response. It appears only the very last insert works and makes root point to it but i cant figure out why
Isnt it still passing in the same thing except in the function call instead of prior to it?
It passes a different variable.
Note that Node*& r is passing the pointer by reference, so that the original value is changed. void Tree::insert(Node*& r, std::string n, std::string p)
r = r->right; will modify the pointer r, which is originally the root variable passed on the first call. insert(root, n, p);