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)  

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

1 Expert Approved Answer
Step: 1 Unlock

The functions youve provided are written in C and they operate on a data structure called a linked l... View full answer

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 Programming Questions!