Question: Implement all four tasks in Lab sheet #10. Please submit one single C/CPP source file which contains all of the required functions including the tasks
Task 1: Write down a complete C/C++ program to test your linear linked list implementation. Additionally, write another function which will be used to list the linked list content. Complete your implementation using the following code: header = insertBack (header, 2); header = insertBack (header, 4); header = insertBack(header,6); DisplayList (header); header = insertFront (header,1); DisplayList (header); insertAfter (header->next->next,5); DisplayList (header); header = deleteFront (header); DisplayList (header); header = deleteBack (header); DisplayList (header); deleteAfter (header->next); DisplayList (header); Task 2: Write a function that inserts a node to no place of a Linear Linked List. Consider the following prototype: struct node * insertn (struct node * p, int n); Task 3: Write a function that deletes all the nodes in the given linked list. void deletelist (struct node *); Task 4: Write a function that copies a linked list. Source and destination lists are the input parameters to the function. void copylist (struct node * struct node *)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
