Can anyone help me with this code sample.

This is from my sample final. Not HW. You can find it here if you don't believe me: http://web.cecs.pdx.edu/~karlaf/CS162_Summer09/CS162_Sample_Final_Questions.html

anyways, the instructor (for some reason) did not put the solutions for the following:



previous page:
struct node {
char * name;
char phone[21];
node * next;
};

node * head;

2. (25 points) Assume the following class builds a linear linked list:

2a. Write at least 4 prototypes and all of the data members for managing a LLL of names/email addresses. You may use the node struct from the previous page.

*** All data must be obtained by the calling routine – NOT from the user! ***

class list { //maintains a linked list address book
public:
//Create at least 4 member function prototypes here





private:


};

2b. Write the code for the constructor:







2c. Write the code for the destructor:















(25 points)

3. C++ Coding Questions.

Assume that you have a linear linked list of just integers

Write the code to insert a node at the END of an existing linear linked list.













Write the code to display every other integer in the linear linked list












Write the code to delete all nodes in a LLL










3. (25 points) Short Answer and pointer arithmetic

a. When should we pass pointers by reference?




can anyone please help me with this
Topic archived. No new replies allowed.