my code is showing run time error,what is the problem
my code is:
node* kthnode(nodehead,int k)
{
nodeslow=head;
node*fast=head;
for(int i=1;i<=k;i++)
fast=fast->next;
while(fast!=NULL)
{
fast=fast->next;
slow=slow->next;
}
return slow;
}