链表
xiaocong1990
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[leetcode]circular-array-loop 环形数组是否存在循环
【代码】[leetcode]circular-array-loop 环形数组是否存在循环。原创 2024-07-10 19:59:41 · 480 阅读 · 0 评论 -
[leetcode]partition-list 分隔链表
【代码】[leetcode]partition-list 分隔链表。原创 2024-07-10 15:20:53 · 519 阅读 · 0 评论 -
[leetcode]swap-nodes-in-pairs
【代码】[leetcode]swap-nodes-in-pairs。原创 2024-06-12 11:41:32 · 304 阅读 · 0 评论 -
[leetcode]234. Palindrome Linked List
题目链接 :https://leetcode.com/problems/palindrome-linked-list/ Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? class原创 2016-11-14 08:49:36 · 284 阅读 · 1 评论 -
[leetcode]148. Sort List
题目链接:https://leetcode.com/problems/sort-list/#/description Sort a linked list inO(nlogn) time using constant space complexity. /** * Merge sort use bottom-up policy, * so Space原创 2017-05-17 11:09:02 · 522 阅读 · 1 评论 -
[leetcode]删除链表中倒数第k个结点
【代码】[leetcode]删除链表中倒数第k个结点。原创 2024-06-12 10:01:35 · 402 阅读 · 0 评论 -
[leetcode]143. Reorder List
题目链接:https://leetcode.com/problems/reorder-list/#/description Given a singly linked listL:L0→L1→…→Ln-1→Ln, reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering原创 2017-05-26 10:47:52 · 298 阅读 · 1 评论 -
[leetcode]19. Remove Nth Node From End of List
题目链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Given a linked list, remove thenthnode from the end of list and return its head. For example, Given linked list: 1->2原创 2016-11-10 15:49:28 · 282 阅读 · 2 评论 -
[leetcode]92. Reverse Linked List II
题目链接:https://leetcode.com/problems/reverse-linked-list-ii/#/description Reverse a linked list from positionmton. Do it in-place and in one-pass. For example: Given1->2->3->4->5->NULL,m=原创 2017-05-13 11:50:56 · 234 阅读 · 1 评论 -
[leetcode]remove-duplicates-from-sorted-list
删除所有重复的元素,使每个元素只出现一次。给定一个已排序的链表的头。原创 2024-04-10 21:30:00 · 561 阅读 · 0 评论 -
[leetcode]remove-duplicates-from-sorted-list-ii
删除原始链表中所有重复数字的节点,只留下不同的数字。给定一个已排序的链表的头。原创 2024-04-10 21:25:11 · 432 阅读 · 0 评论 -
[leetcode]从链表中删去总和值为零的连续节点
的连续节点组成的序列,直到不存在这样的序列为止。删除完毕后,请你返回最终结果链表的头节点。(注意,下面示例中的所有序列,都是对。,请你编写代码,反复删去链表中由。你可以返回任何满足题目要求的答案。答案 [1,2,1] 也是正确的。给你一个链表的头节点。原创 2024-04-09 15:06:07 · 485 阅读 · 0 评论 -
[leetcode]合并K个升序链表
【代码】[leetcode]合并K个升序链表。原创 2024-04-08 20:35:47 · 171 阅读 · 0 评论 -
[LeetCode] Reverse Linked List
Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursi...原创 2020-04-04 16:57:24 · 318 阅读 · 1 评论 -
[leetcode]25. Reverse Nodes in k-Group
题目链接:https://leetcode.com/problems/reverse-nodes-in-k-group/description/ Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive i原创 2017-08-16 12:08:34 · 254 阅读 · 0 评论 -
[lintcode]904. Plus One Linked List
链接:http://www.lintcode.com/zh-cn/problem/plus-one-linked-list/ Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume原创 2018-04-12 19:06:56 · 308 阅读 · 0 评论 -
[lintcode]36. 翻转链表 II
链接:http://www.lintcode.com/zh-cn/problem/reverse-linked-list-ii/ 翻转链表中第m个节点到第n个节点的部分 注意事项 m,n满足1 ≤ m ≤ n ≤ 链表长度 您在真实的面试中是否遇到过这个题? Yes 样例 给出链表1->2->3->4->原创 2018-04-02 12:27:30 · 342 阅读 · 0 评论 -
[lintcode]98. 链表排序
链接:http://www.lintcode.com/zh-cn/problem/sort-list/ 在 O(n log n) 时间复杂度和常数级的空间复杂度下给链表排序。 您在真实的面试中是否遇到过这个题? Yes 样例 给出 1->3->2->null,给它排序变成 1->2->3->null. 思路:对链原创 2018-04-08 19:01:37 · 363 阅读 · 0 评论 -
[leetcode]138. Copy List with Random Pointer
题目链接:https://leetcode.com/problems/copy-list-with-random-pointer/tabs/description A linked list is given such that each node contains an additional random pointer which could point to any node in原创 2017-07-28 16:31:56 · 266 阅读 · 0 评论 -
[leetcode]82. Remove Duplicates from Sorted List II
题目链接:https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/#/description Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from原创 2017-07-26 20:29:10 · 306 阅读 · 0 评论 -
[leetcode]142. Linked List Cycle II
题目链接:https://leetcode.com/problems/linked-list-cycle-ii/#/description Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. Note:Do not modify the li原创 2017-07-26 17:41:26 · 256 阅读 · 0 评论
分享