Question: What does the following functions do? a. int mystry (struct node* head) { int count = 0; } b. struct node* current = head;
What does the following functions do? a. int mystry (struct node* head) { int count = 0; } b. struct node* current = head; while (current != NULL) { count++; current = current->next } return (count); struct node* mystry (struct node* head) { struct node* a = head; struct node* b = NULL; struct node* tail = NULL; while (a != NULL) { if (b == NULL) { b = malloc(sizeof(struct node)); b->data= a->data; b->next = NULL; tail = b; } else { tail->next = malloc(sizeof(struct node)); tail tail->next; tail->data = a->data; tail->next = NULL; } a = a->next; } return (b);
Step by Step Solution
There are 3 Steps involved in it
The functions youve provided are written in C and they operate on a data structure called a linked l... View full answer
Get step-by-step solutions from verified subject matter experts
