So I am trying to implement a recursive version of the insert function and this is my current attempt. I can get it to change the data stored in the root node but the child nodes don't seem to hold anything. I believe that it is a reference problem but I just don't know how to make this work correctly. So how can I do this correctly? Even just showing me the insert function arguments would help.
Can someone explain what's going on in these 2 lines?
insert(&root, x);
void Btree::insert(Node **root, int x) {
I know that a reference to a root pointer which points to a node object is being passed but in the function argument, of the second snippet, is that dereferencing the root pointer so that I can access the contents of the node object?