[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Data Structures :: Linked Lists - Discussion

Home > Data Structures > Linked Lists > MCQs Questions Discussion

14 / 48

Choose the correct option.

"p" and "q" are pointers to a node of the linked list, "head" points to the first node of the list, "next" points to the next node in the list, which of the following is true for the following piece of code:

for (p=head, q = head; p!=NULL; q = p)
{
p = p->next;
free(q);
}

ADeletes all nodes

BDeletes all but the last node

CDoes not delete any node

DThe program will crash

Answer: Option (Login/Signup)

Show Explanation

Asked In :: Capgemini Infosys

Post Your Answer Here:     

No Discussion on this question yet!