Question: #include 2 #include 500 OO CON 4 typedef struct _node { int data; struct _node * next; 7} node_t; typedef struct { node_t * head;

 #include 2 #include 500 OO CON 4 typedef struct _node {int data; struct _node * next; 7} node_t; typedef struct { node_t

#include 2 #include 500 OO CON 4 typedef struct _node { int data; struct _node * next; 7} node_t; typedef struct { node_t * head; node_t * tail; 12 } LL_t; LL_t * LLcreate() { LL_t * ret = malloc(sizeof(LL_t)); ret->head = NULL; ret->tail = NULL; return ret; void LLappend(LL_t * intlist, int value) { node_t * new Node = malloc(sizeof(node_t)); newNode->data = value; newNode->next = NULL; if (intlist ->head == NULL) { intlist->head = newNode; intlist ->tail = newNode; } else { intlist ->tail->next = newNode; intlist ->tail = newNode; Currently, two functions have been implemented: LLcreate and LLappend. In this question, you will implement two additional functions. Please use comments to explain your code. a) (20 marks) Write a function called LLcomp that compares two linked lists. The function should return 1 if the two linked lists are equal in length and contains all the same elements in the same order. Otherwise, the function should return 0. The function prototype is given below: int LLcomp (LL_t * intlisti, LL_t * intlist2) { CON O. O b) (16 marks) Write a function called LLupdate that updates the value of a node in a linked list. If the node is not found, the linked list should not change; instead, the user should get the following message: Node not found! The function prototype is given below: i void LLupdate (LL_t * intlist, node_t * n, int value) { OCT CON

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!