#include #include using namespace std; template class Node{ private: T value; Node *next; public: Node(); Node (T data); T remove(); T getValue(); Node* getNext(); void setValue(T data); void setNext(Node *nextNode); }; template Node::Node(){ T value =NULL; } template Node::Node(T data){ T value=data; } template T Node::getValue(){ return value; } template Node* Node::getNext(){ return next; } template void Node::setValue(T data){ T value=data; } template void Node::setNext(Node *nextNode){ next=nextNode; } template class MyLinkedList{ Node start; //Define a constructor MyLinkedList() { start->setValue(0); start->setNext(NULL); } //Member Functions: // Adds a new element to the list void add (T val) { /* creating a new node to hold value*/ Nodetemp(val,NULL); /* If no start node till now, this node is made as start node*/ if (start->next == NULL) { start.setNext(temp); } /* if start node exists, insert new node at end of list*/ else { s = start->next; /* locating end of list*/ while (s->next != NULL) { s= s->next; } temp->next = NULL; /* attaching new node */ s->next = temp; cout<<\"Element Inserted\"<next->next != NULL) { s = s->next; } //After locating the end node ptr=s->next; s->next=NULL; //deletting end node return ptr; } } //Prints elements of the list void printContent() { struct node *ptr = start; cout<data; ptr=ptr->next; } } } //Prints total number of elements int getSize() { struct node *ptr, *s; int count=0; if (start == NULL) { cout<<\"The List is empty\"<next; count=1; while (ptr != NULL) { count++; ptr=ptr->next; } return count; } //Returns true if there is no element in the list. bool empty() { if(start==NULL) { return empty; } } }; Solution #include #include using namespace std; template class Node{ private: T value; Node *next; public: Node(); Node (T data); T remove(); T getValue(); Node* getNext(); void setValue(T data); void setNext(Node *nextNode); }; template Node::Node(){ T value =NULL; } template Node::Node(T data){ T value=data; } template T Node::getValue(){ return value; } template Node* Node::getNext(){ return next; } template void Node::setValue(T data){ T value=data; } template void Node::setNext(Node *nextNode){ next=nextNode; } template class MyLinkedList{ Node start; //Define a constructor MyLinkedList() { start->setValue(0); start->setNext(NULL); } //Member Functions: // Adds a new element to the list void add (T val) { /* creating a new node to hold value*/ Nodetemp(val,NULL); /* If no start node till now, this node is made as start node*/ if (start->next == NULL) { start.setNext(temp); } /* if start node exists, insert new node at end of list*/ else { s = start->next; /* locating end of list*/ while (s->next != NULL) { s= s->next; } temp->next = NULL; /* attaching new node */ s->next = temp; cout<<\"Element Inserted\"<next->next != NULL) { s = s->next; } //After locating the end node ptr=s->next; s->next=NULL; //deletting end node return ptr; } } //Prints elements of the list void printContent() { struct .