


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



#include
template
void main() { Node
Node
// set ll’s ptr member variable to // point to the same thing as variable q ll->ptr = q;
cout << "1st value: " << ll->value << "\n" << "2nd value: " << ll->ptr->value << endl; }
6
ll
value ptr
value ptr
q
NULL
8
Suppose p points to a node that should be removed from a linked list, q points to the node before p, and head points to the first node in the linked list. Write code to remove p, making sure that if p points to the first node that head points to what was the second node and now is the first after p is removed.
Write a recursive function to copy all nodes in a linked list to form an new linked list of nodes with identical structure and values. Here’s the function prototype:
template
Here is a summary of common mistakes. Read these carefully, and read them again when you have problem that you need to solve.
template