码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
92. Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- ...
分类:其他好文   时间:2019-04-09 17:04:04    阅读次数:152
142. Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you ...
分类:其他好文   时间:2019-04-09 16:55:57    阅读次数:173
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 must do this in-place without altering the nodes' values. For ...
分类:其他好文   时间:2019-04-09 16:52:33    阅读次数:130
147. Insertion Sort List
Sort a linked list using insertion sort. public class Solution { public ListNode insertionSortList(ListNode head) { ListNode root = new ListNode(0); / ...
分类:其他好文   时间:2019-04-09 16:52:19    阅读次数:118
24. Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a ...
分类:其他好文   时间:2019-04-09 16:44:26    阅读次数:112
19. Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on ...
分类:其他好文   时间:2019-04-09 16:38:07    阅读次数:151
148. Sort List
Sort a linked list in O(n log n) time using constant space complexity. //利用归并排序的思想 class Solution { public ListNode sortList(ListNode head) { if (head ...
分类:其他好文   时间:2019-04-09 16:34:21    阅读次数:152
链表的类模型
* Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } ...
分类:其他好文   时间:2019-04-09 16:29:28    阅读次数:146
83.Remove Duplicates from Sorted List
``` /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class ... ...
分类:其他好文   时间:2019-04-09 12:32:43    阅读次数:152
LeetCode::Sort List 具体分析
Sort a linked list in O(n log n) time using constant space complexity. 这道题目非常简短的一句话。给链表排序,看到nlogn。我们能够来简单复习一下排序。首先说一下这个nlogn的时间复杂度(依据决策树我们能够得出这个界限)。是基 ...
分类:其他好文   时间:2019-04-07 16:57:10    阅读次数:126
3784条   上一页 1 ... 40 41 42 43 44 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!