Use the declaration below to answer the following questions.
node *p, *r, *s;
p = NULL;
s = new node;
r = s;
| |
->
notation, to make
the change indicated by the dotted line.
node *p, *r,*s;
p = new node;
s = new node;
r = new node;
p -> next = r;
r -> next = s;
s -> next = p;
s -> info = 3;
p ->next -> next -> next -> info = 2;
s -> next -> next -> info = 1;
p = s -> next;
cout << p -> info << " " << s -> info << " " << r -> info;
node *p,*s;
s = new node;
p = new node;
p -> info = 7;
s->info = 8;
s -> next = p;
s -> next -> info = 5;
s -> next -> next = p;
p -> next -> info = 4;
s ->info = p -> next ->info;
cout << p -> info << " " << s -> next -> next -> info << " " << q -> info;