Topic description
Input a linked list and output the k-th node from the bottom of the linked list.
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead, unsigned int k) { ListNode* list = pListHead; int len = 0; while(list!=NULL){ list=list->next; len ++; } len = len-k; list = pListHead; if(len>=0){ while(len--){ list=list->next; } return list; }else return NULL; } };