Delete Entire Linked List

How to delete a entire linked list?

Questions by shyamkumar1221

Showing Answers 1 - 3 of 3 Answers

You delete a linked list by iterating through the list and deleting the nodes one by one.
Begin at the head
Get address of first node
Get address of next node
Delete first node
Do not to access next of the current node after deleting the current node.
Move next node to first node
Repeat

If the list is empty, the head pointer will be NULL.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions