Programming Concepts Question: Download Programming Concepts PDF

How to delete a entire linked list?

Tweet Share WhatsApp

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.

Download Programming Concepts PDF Read All 112 Programming Concepts Questions
Previous QuestionNext 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?