How can we delete a linklist without using start pointer Pls specify the code

Showing Answers 1 - 2 of 2 Answers

Nitin Gupta

  • Jan 3rd, 2006
 

Use a doubly linked list, then you can start from the current pointer and go back and forth and delete the nodes.

  Was this answer useful?  Yes

samiksc

  • Jan 19th, 2006
 

In a circular singly linked list also it is possible to use the current pointer and delete all nodes. The pseudo code would be like this:

while (curr != null)

{

linkList *ptr = curr->next;

free(curr);

curr = ptr;

}

  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