

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
if( a != NULL && b!= NULL ) { if (a->next == NULL) a->next = b; else concatenate(a->next,b); } else { cout << "Either a or b is NULL\n"; } } void front(int n) { node *tmp = new node; tmp -> data = n; tmp -> next = head; head = tmp; } void after(node a, int value) { node p = new node; p->data = value; p->next = a->next; a->next = p; } void del (node before_del) { node temp; temp = before_del->next; before_del->next = temp->next; delete temp; } }; int main() { linked_list a; a.add_node(1); a.add_node(2); a.front(3); a.add_node(5); a.add_node(15); cout<<"Elements of Linked List "<<endl; linked_list::display(a.gethead()); a.del(a.gethead()->next); cout<<"Elements of Linked List Afetr Deletion"<<endl; linked_list::display(a.gethead()); return 0; }