#include struct node { char value; struct node *next; }; class StringOfNode { struct node * head; public: StringOfNode() { head=NULL; } int size() { struct node *p=head; int count=1; while(p) { count++; p=p->next; } return count; } struct node * begin() { return head; } char &operator[](int index) { int i=0; struct node *p=head; while(index!=i) { p=p->next; i++; } return p->value; } void insertFront(char valuee) { struct node * temp=(struct node *)malloc(sizeof(struct node)); temp->value=valuee; temp->next=NULL; if(head==NULL) head=temp; else { temp->next=head; head=temp; } } void insert(char valuee, int pos) { struct node *p=head; struct node * temp=(struct node *)malloc(sizeof(struct node)); temp->value=valuee; temp->next=NULL; int i=0; if(p==NULL) { head=temp; } else { while(i!=pos-1) { p=p->next; i++; } temp->next=p->next; p->next=temp; } } void insertBack(char valuee) { struct node *p=head; struct node * temp=(struct node *)malloc(sizeof(struct node)); temp->value=valuee; temp->next=NULL; if(p==NULL) { head=temp; } else { while(p->next!=NULL) p=p->next; p->next=temp; } } void print() { struct node *p=head; while(p) { std::cout<value<<\"\ \"; p=p->next; } } StringOfNode operator+(const StringOfNode& b) { StringOfNode *S; struct node *p=head; while(p->next!=NULL) p=p->next; p->next=S->begin(); } }; int main() { StringOfNode *p1=new StringOfNode; p1->insertBack(\'b\'); p1->insertBack(\'c\'); p1->insertBack(\'e\'); p1->insert(\'d\',2); p1->insertFront(\'a\'); p1->print(); system(\"pause\"); return 0; } Solution #include struct node { char value; struct node *next; }; class StringOfNode { struct node * head; public: StringOfNode() { head=NULL; } int size() { struct node *p=head; int count=1; while(p) { count++; p=p->next; } return count; } struct node * begin() { return head; } char &operator[](int index) { int i=0; struct node *p=head; while(index!=i) { p=p->next; i++; } return p->value; } void insertFront(char valuee) { struct node * temp=(struct node *)malloc(sizeof(struct node)); temp->value=valuee; temp->next=NULL; if(head==NULL) head=temp; else { temp->next=head; head=temp; } } void insert(char valuee, int pos) { struct node *p=head; struct node * temp=(struct node *)malloc(sizeof(struct node)); temp->value=valuee; temp->next=NULL; int i=0; if(p==NULL) { head=temp; } else { while(i!=pos-1) { p=p->next; i++; } temp->next=p->next; p->next=temp; } } void insertBack(char valuee) { struct node *p=head; struct node * temp=(struct node *)malloc(sizeof(struct node)); temp->value=valuee; temp->next=NULL; if(p==NULL) { head=temp; } else { while(p->next!=NULL) p=p->next; p->next=temp; } } void print() { struct node *p=head; while(p) { std::cout<value<<\"\ \"; p=p->next; } } StringOfNode operator+(const StringOfNode& b) { StringOfNode *S; struct node *p=head; while(p->next!=NULL) p=p->next; p->next=S->begin(); } }; int main() { StringOfNode *p1=new StringOfNode; p1->insertBack(\'b\'); p1->insertBack(\'c\'); p1->insertBack(\'e\'); p1->insert(\'d\',2.