Question: answer in C code please Suppose we have a linked list implemented with the structure below. Write a function that will take in pointer to


Suppose we have a linked list implemented with the structure below. Write a function that will take in pointer to the head of a list and inserts a node storing 1 after each even value in the list. If the list is empty or there are no even values in the list, no modifications should be made to the list. (For example if the initial list had 2,6,7,1,3, and 8 , the resulting list would have 2,1,6,1,7,1,8,1.) typedef struct node \{ int data; struct node* next; \} node; void markEven(node* head) \{ \} void deallocateList(node** head) \{ node tmp = *head; while (tmp != NULL) \{ "head = tmp->next; free(tmp); tmp= "head; \} "head = NULL; \} int insertlist(node** head, int data) \{ node newNode =( node ) malloc(sizeof(node)); if (newNode == NULL) return-1; newNode > data = data; newNode->next = NULL; newNode->next = "head; "head = newNode; return 1; \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
