![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
链表
zyp7355
这个作者很懒,什么都没留下…
展开
-
leetcode #92Reverse Linked List II
Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: Input: 1->2->3->4->5->NULL, m = 2, n = 4 Output: 1->4->3->2->5->...原创 2020-04-17 05:56:59 · 137 阅读 · 1 评论 -
leetcode#86. Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of th...原创 2020-02-21 04:58:34 · 55 阅读 · 0 评论 -
Leetcode #24. Swap Nodes in Pairs java
Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list’s nodes, only nodes itself may be changed. Example: Given 1->2->3->4, you sho...原创 2020-03-24 06:23:59 · 66 阅读 · 0 评论 -
#148. Sort List
Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4 Example 2: Input: -1->5->3->4->0 Output: -1->0-&...原创 2020-03-07 05:57:07 · 66 阅读 · 0 评论 -
leetcode #147. Insertion Sort List
Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially contains only the first element in the list. With each iteration one element (...原创 2020-03-06 14:49:19 · 86 阅读 · 0 评论 -
leetcode #143. Reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list’s nodes, only nodes itself may be changed. Example 1: Given 1->2->...原创 2020-03-06 04:02:44 · 72 阅读 · 0 评论 -
leetcode#142. Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-in...原创 2020-03-05 08:08:23 · 67 阅读 · 0 评论 -
leetcode #141. Linked List Cycle
Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail con...原创 2020-03-05 06:52:13 · 62 阅读 · 0 评论 -
leetcode#83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input: 1->1->2->3->3 Output: 1->2-&...原创 2020-02-20 14:14:40 · 59 阅读 · 0 评论