Question: C++ Language Only please!! Question 3: Assume Node* p points at the first node of a singly-linked list i.e., where each node is a struct

C++ Language Only please!!
Question 3: Assume Node* p points at the first node of a singly-linked list i.e., where each node is a struct Node { Object data; Node* next; }. For each of the code fragments hereafter, explain exactly what it will do, or else why it will not compile, or cause a runtime error, etc. (3 marks) a) while (p != nullptr) { node* n = p++; delete n; } b) while (p != nullptr) { Node* n = p = p->next; delete n; } c) while (p != nullptr) { Node* n = p->next; delete p; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
