链表
xiaocong1990
这个作者很懒,什么都没留下…
展开
-
[leetcode]remove-duplicates-from-sorted-list
删除所有重复的元素,使每个元素只出现一次。给定一个已排序的链表的头。原创 2024-04-10 21:30:00 · 448 阅读 · 0 评论 -
[leetcode]remove-duplicates-from-sorted-list-ii
删除原始链表中所有重复数字的节点,只留下不同的数字。给定一个已排序的链表的头。原创 2024-04-10 21:25:11 · 321 阅读 · 0 评论 -
[leetcode]从链表中删去总和值为零的连续节点
的连续节点组成的序列,直到不存在这样的序列为止。删除完毕后,请你返回最终结果链表的头节点。(注意,下面示例中的所有序列,都是对。,请你编写代码,反复删去链表中由。你可以返回任何满足题目要求的答案。答案 [1,2,1] 也是正确的。给你一个链表的头节点。原创 2024-04-09 15:06:07 · 370 阅读 · 0 评论 -
[leetcode]合并K个升序链表
【代码】[leetcode]合并K个升序链表。原创 2024-04-08 20:35:47 · 90 阅读 · 0 评论 -
[LeetCode] Reverse Linked List
Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or recursi...原创 2020-04-04 16:57:24 · 179 阅读 · 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 · 212 阅读 · 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 · 245 阅读 · 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 · 284 阅读 · 0 评论 -
[leetcode]138. Copy List with Random Pointer
题目链接:https://leetcode.com/problems/copy-list-with-random-pointer/tabs/descriptionA 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 · 207 阅读 · 0 评论 -
[leetcode]82. Remove Duplicates from Sorted List II
题目链接:https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/#/descriptionGiven a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from原创 2017-07-26 20:29:10 · 222 阅读 · 0 评论 -
[leetcode]142. Linked List Cycle II
题目链接:https://leetcode.com/problems/linked-list-cycle-ii/#/descriptionGiven 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 · 182 阅读 · 0 评论 -
[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 · 178 阅读 · 0 评论