node* levelbuild(){
int d;
cin>>d;
node * root=new node(d);
queue<node*> q;
q.push(root);
while(!q.empty()){
node *n = q.front();
q.pop();
int c1,c2;
cin>>c1>>c2;
if(c1!=-1){
n->left=new node(c1);
q.push(n->left);
}
if(c2!=-1){
n->right=new node(c2);
q.push(n->right);
}
}
return root;
}
In the above code when we write node *n = q.front(); Basically we are pointing n to the node to which root was already pointing. So whater changes we make to n are reflected in root also. I am right??