struct ListNode
{
int m_nkey;
ListNode *m_pNext;
}
ListNode *FtrKNode(ListNode *pHead)
{
if(k == 0 || pHead == NULL)
return NULL;
ListNode *pAhead = pHead;
ListNode *pBehind = pHead;
while(k > 1 && pAhead != NULL)
{
pAhead = pAhead->m_pNext;
k--;
}
if(k > 1 || pAhead == NULL)
return NULL;
while(pAhead->m_pNext != NULL)
{
pBehind = pBehind->m_pNext;
pAhead = pAhead->m_pNext;
}
return pBehind;
}