
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
This quiz was taken in class of Data Structure course by Shekhar Sharma at B R Ambedkar National Institute of Technology. It includes: Linked, List, Class, Implement, Functions, Remove, Node, Swap, Last, Protected, Public, Items
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

**void removeSecond() //remove every second node from the linked list void swapTwo(node p, node q) //swap the nodes p and q in the linked list void removeSecondLast () //remove the second last node of the linked list class linked_list { protected: struct node { int item; node *next; } node *head; //pointer to the first node of the linked list node *get_node(); void free_node(node *); public: linked_list(); void insert (int x); //insert at the end of the linked list as the last entry void remove (node *p); //remove the node with pointer p from the linked list void list_item(); //print all the items of the linked list **void removeSecond(); //remove every second node from the linked list void swapTwo(node p, node q); // swap the nodes p and q in the linked list void removeSecondLast (); //remove the second last node of the linked list };