GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  OOPS

 Print  |  
Question:  How can we delete a linklist without using start pointer
Pls specify the code




January 01, 2006 05:32:19 #2
 Sameeksha Microsoft Expert  Member Since: October 2005    Total Comments: 231 

RE: How can we delete a linklist without using start p...
 

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;

}

     

 

Back To Question