Question: What does the following function do? struct node { }; int data; struct node* next; static void r(struct node** head_ref) { } struct node*

What does the following function do? struct node { }; int data; 

What does the following function do? struct node { }; int data; struct node* next; static void r(struct node** head_ref) { } struct node* prev = NULL; struct node* current = *head_ref; struct node* next; while (current != NULL) { } next = current->next; current->next = prev: prev = current; current = next; *head_ref=prev:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The given function r appears to be a function that reverses a linked list Heres what the function do... 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!