Question: 1. The following function is to reverse a singly linked list in place. Please complete the function. typedef struct Node { Elem Type DATA; /*data

1. The following function is to reverse a singly linked list in place. Please complete the function. typedef struct Node { Elem Type DATA; /*data field */ struct Node *LINK; /*pointer/link field*/ }Node; void reverse(Node *HEAD) { Node *p,*q; p=HEAD; p=p->next; HEAD->next=_ ; Il generate an empty new linked list while(p) { 992; p=p->next; q->next=HEAD->next; HEAD->next= ; /* insert the nodes in the old linked list into the front of the new linked list one by one. */ }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
