node*
reverse(node *r)
{
if(r->next!=NULL)
{
reverse(r->next);
r->next->next=r;
return r;
}
else
start=r;
}
void i_reverse()
{
node *p=start,*q=p->next,*r=q->next;
p->next=NULL;
while(q!=NULL)
{
q->next=p;
p=q;
q=r;
if( r != NULL)
if( r != NULL)
r=r->next;
}
start=p;
}
No comments:
Post a Comment