i saw this code to insert a node in a linklist,but i dont get whats
the need to use **p.Cant I just use *p
void insertlist(intnode**p,int i,intnode *t) //use *p
{
int j;
intnode *q,*x;
if(i==0)
{
t->next =(*p); //t->next=p;
(*p)=t; //p=t;
return;
}
q=*p; //q=p;
for(j=1;(j<i) && (q!=NULL);j++)
q=q->next;
if(q==NULL && i>0)
return;
x=q;
t->next=x->next;
x->next=t;
return;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---