链表中倒数第k个结点
时间限制:1秒
空间限制:32768K
热度指数:348228
本题知识点:
链表
算法知识视频讲解
题目描述
输入一个链表,输出该链表中倒数第k个结点。
笔记
收藏
纠错
链表中倒数第k个结点
返回全部题目
剑指Offer_编程题
列表加载中...
上一题
下一题
讨论
排行
保存并调试
求助
做题遇到困难?
查看通过的代码
参与大家的讨论
查看编程常见问题
保存并调试之后,这里将会显示运行结果
/* public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } }*/ public class Solution { public ListNode FindKthToTail(ListNode head,int k) { } }
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead, unsigned int k) { } };
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def FindKthToTail(self, head, k): # write code here
/* public class ListNode { public int val; public ListNode next; public ListNode (int x) { val = x; } }*/ class Solution { public ListNode FindKthToTail(ListNode head, int k) { // write code here } }
/*function ListNode(x){ this.val = x; this.next = null; }*/ function FindKthToTail(head, k) { // write code here } module.exports = { FindKthToTail : FindKthToTail };
val = $x; } }*/ function FindKthToTail($head, $k) { // write code here }
/*function ListNode(x){ this.val = x; this.next = null; }*/ function FindKthToTail(head, k) { // write code here }