Loading

摘要: 面试题 02.02. Kth Node From End of List LCCI Implement an algorithm to find the kth to last element of a singly linked list. Return the value of the elem 阅读全文
posted @ 2021-09-22 11:25 Pen9 阅读(35) 评论(0) 推荐(0)
摘要: 剑指 Offer 24. 反转链表 定义一个函数,输入一个链表的头节点,反转该链表并输出反转后链表的头节点。 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 限制: 0 ⇐ 节点个数 ⇐ 5000 /** * Definition for si 阅读全文
posted @ 2021-09-22 11:21 Pen9 阅读(29) 评论(0) 推荐(0)
摘要: 剑指 Offer 06. 从尾到头打印链表 输入一个链表的头节点,从尾到头反过来返回每个节点的值(用数组返回)。 示例 1: 输入:head = [1,3,2] 输出:[2,3,1] 限制: 0 ⇐ 链表长度 ⇐ 10000 /** * Definition for singly-linked li 阅读全文
posted @ 2021-09-22 11:15 Pen9 阅读(28) 评论(0) 推荐(0)