- Home
- Ask a Question
- Question Details
(reversing a link list)
void(struct node**p)
{struct node*q,*r;
if(*p!=NULL||*p->link!=NULL)
{r=q;
q=*p;
*p=*p->link;
}
else
{q->link=NULL;
*p->link=q;
}
else if(*p==NULL)
printf(\"no element\");
else
printf(\"1 element so no reversing\");
}
}
plzzz tell me whether my logic is correct or not