Question: Write a function to reverse the direction of the pointers in a singly- linked list if a. the structure of the singly linked list
Write a function to reverse the direction of the pointers in a singly- linked list if a. the structure of the singly linked list is Template Struct Node { T Value; Node * next; }; Assume the function call is void Reverse (Node * &head) and the head is to be changed to point to the node that was previously the tail. Comment your code as much as possible [7 Marks]
Step by Step Solution
There are 3 Steps involved in it
The function will be include template struct Node T value Node next template void ReverseNode head C... View full answer
Get step-by-step solutions from verified subject matter experts
