Programming Concepts Question:
How to delete a entire linked list?
Answer:
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.
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.
Previous Question | Next Question |
Explain how to calculate response time in Client-Server technology? | Define ROM image and explain each section of a ROM image in an exemplary system? |