1.

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.

You delete a linked list by iterating through the list and deleting the nodes one by one.

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



Discussion

No Comment Found