Question: Given this node structure: struct Node { int data; struct Node * next; } ; What happens if we execute free ( current ) without
Given this node structure:
struct Node int data; struct Node next; ;
What happens if we execute freecurrent without first preserving currentnext?
Nothing; the rest of the list remains accessible
The next node becomes the head of the list
The memory is freed, but the link is preserved
The rest of the list becomes inaccessible, causing a memory leak
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
