码迷,mamicode.com
首页 >  
搜索关键字:linked    ( 5490个结果
Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./***Defin...
分类:其他好文   时间:2014-06-04 19:23:45    阅读次数:243
Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:其他好文   时间:2014-06-04 19:19:16    阅读次数:205
Reverse Linked List II
Reverse 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,return1->4->3->2->5->NULL.No...
分类:其他好文   时间:2014-06-04 18:55:07    阅读次数:343
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-06-03 14:12:24    阅读次数:306
Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2014-05-30 16:15:02    阅读次数:224
Linked List Cycle
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. *...
分类:其他好文   时间:2014-05-30 16:08:05    阅读次数:238
Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?/**...
分类:其他好文   时间:2014-05-30 15:59:56    阅读次数:249
Sort List
Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * L...
分类:其他好文   时间:2014-05-30 15:17:18    阅读次数:312
Insertion Sort List
Sort a linked list using insertion sort./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNo...
分类:其他好文   时间:2014-05-30 15:14:27    阅读次数:245
Copy List with Random Pointer
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-05-30 15:07:49    阅读次数:260
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!