码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
LeetCode[Linked List]: 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->5->NULL. Note: Given m, n satisfy the f...
分类:其他好文   时间:2014-11-04 21:14:42    阅读次数:157
[LeetCode]Copy List with Random Pointer复杂链表的复制
/** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), ...
分类:其他好文   时间:2014-11-04 11:11:48    阅读次数:216
[LeetCode] 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-11-04 10:40:26    阅读次数:143
LeetCode Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for singly-linked ....
分类:其他好文   时间:2014-11-03 23:53:07    阅读次数:185
LeetCode[Linked List]: 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, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked ...
分类:其他好文   时间:2014-11-03 21:02:22    阅读次数:182
[leetCode] 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-11-03 20:48:12    阅读次数:249
[LeetCode] 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?思路:快慢指针的应用。快慢指针指的是移动的步长,即每次向前移动的快慢。例如可以让快指...
分类:其他好文   时间:2014-11-03 20:42:18    阅读次数:204
LeetCode[Linked list]: Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. 看到这个题目感到奇怪的是为什么是“右旋”,而不是“左旋...
分类:其他好文   时间:2014-11-02 13:54:27    阅读次数:225
Remove Duplicates from Sorted List II 移除有序链表中的重复项之二
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:其他好文   时间:2014-11-02 13:41:39    阅读次数:168
LeetCode[Linked List]: Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. ...
分类:其他好文   时间:2014-11-02 09:27:14    阅读次数:276
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!