码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
[Leetcode] Partition List
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:其他好文   时间:2014-11-16 09:24:55    阅读次数:216
Leetcode-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 o...
分类:其他好文   时间:2014-11-16 08:15:41    阅读次数:222
Leetcode-Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2...
分类:其他好文   时间:2014-11-16 08:14:02    阅读次数:220
Leetcode-Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3,...
分类:其他好文   时间:2014-11-16 08:11:30    阅读次数:220
Leetcode-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->...
分类:其他好文   时间:2014-11-16 07:06:37    阅读次数:173
Insertion Sort List
Sort a linked list using insertion sort.C++代码如下:#include#includeusing namespace std;//Definition for singly-linked list.struct ListNode{ int val; ...
分类:其他好文   时间:2014-11-15 21:34:17    阅读次数:297
LeetCode Reverse Linked List II
Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return...
分类:其他好文   时间:2014-11-15 00:05:30    阅读次数:259
LeetCode Remove Nth Node From End of List 删除链表的倒数第n个结点
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), ne...
分类:其他好文   时间:2014-11-15 00:03:01    阅读次数:364
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->3->4->5, and n = 2. After re...
分类:其他好文   时间:2014-11-14 22:27:28    阅读次数:175
Copy List with Random Pointer (16)
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ...
分类:其他好文   时间:2014-11-14 22:21:16    阅读次数:194
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!