



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: DATA STRUCTURES; Subject: Computer Science; University: Rensselaer Polytechnic Institute; Term: Unknown 1989;
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




#include
template
void main() { Node
Node
ll->ptr = q; // ll’s ptr member variable now has the same value // as the pointer variable q
cout << "1st value: " << ll->value << "\n" << "2nd value: " << ll->ptr->value << endl; }
ll
value ptr
value ptr
q 6
Based on the foregoing discussion, write the templated function is_there
template
Write push_back.
Node
Suppose p points to 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.