链表中倒数第k个结点
链表中倒数第k个结点
http://www.nowcoder.com/questionTerminal/886370fe658f41b498d40fb34ae76ff9
//解题思路:链表倒数问题用快慢指针解决 public ListNode FindKthToTail (ListNode pHead, int k) { ListNode fast = pHead; for(int i = 0; i < k; i++) { if(fast == null) { return fast; } fast = fast.next; } ListNode slow = pHead; while(fast != null) { fast = fast.next; slow = slow.next; } return slow; }