Question: Write a C++ function to double the value of each node in a linked list. The function takes one argument, which is the linked list
Write a C++ function to double the value of each node in a linked list. The function takes one argument, which is the linked list head:
void LinkedListDouble(Node *head);
The linked list structure:
struct Node { int value; Node *next; }; Example, if Linked List is: 5 -> 12 -> 3 -> NULL then the resulting Linked List would be: 10 -> 24 -> 6 -> NULL
Your function does not print anything; our code will traverse the linked list and print as the example shown below.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
