node* rev(node*&head,int k)
{
node*p=NULL;
node*c=head;
node* n=NULL;
int cnt=0;
while(c!=NULL and cnt<k)
{
n=c->next;
c->next=p;
p=c;
c=n;
cnt++;
}
if((n)!=NULL)
{
head->next=rev(n,k);
}
return p;
}
what is problem with this function?