Question: The following function reverse ( ) is supposed to reverse a singly linked list. There is one line missing at the end of the function.
The following function reverse is supposed to reverse a singly linked
list. There is one line missing at the end of the function.
headref is a double pointer which points to head pointer
of linked list
static void reverseNode headref
Node prev null;
Node current headref;
Node next;
while current null
next current.next;
current.next prev;
prev current;
current next;
ADD A STATEMENT HERE
A headref current;
B headref prev;
C headref null;
D headref next;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
