//Implement an algorithm to find the nth to last element of a singly linked list.
struct LinkNode
{
LinkNode * next;
int value;
}
LinkNode * findLastN(LinkNode * head, int n)
{
int i = 1;
LinkNode * start;
while (i < n && start != NULL)
{
start = start->next;
i ++;
}
if (start == NULL)
return NULL;
LinkNode * h = head;
while (start->next != NULL)
{
h = h->next;
start = start->next;
}
return h;
}