码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
Leetcode: 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-09-16 04:57:10    阅读次数:134
[leetcode]Swap Nodes in Pairs @ Python
原题地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2...
分类:编程语言   时间:2014-09-15 06:38:18    阅读次数:200
[LeetCode] Reverse Linked List II @ Python
原题地址:https://oj.leetcode.com/problems/reverse-linked-list-ii/题意:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Gi...
分类:编程语言   时间:2014-09-14 23:38:47    阅读次数:239
Flatten Binary Tree to Linked List <leetcode>
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2014-09-13 22:39:06    阅读次数:238
leetcode sort List
Sort a linked list in O(n log n) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * ...
分类:其他好文   时间:2014-09-13 21:25:35    阅读次数:288
Sort List
Sort a linked list inO(nlogn) time using constant space complexity. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int ...
分类:其他好文   时间:2014-09-13 20:08:05    阅读次数:204
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? 1 /** 2 * Definition for singly-linked l....
分类:其他好文   时间:2014-09-13 20:06:35    阅读次数:184
Insertion Sort List
Sort a linked list using insertion sort. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *nex...
分类:其他好文   时间:2014-09-13 20:05:15    阅读次数:180
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? 1 ...
分类:其他好文   时间:2014-09-13 20:03:55    阅读次数:205
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-09-13 20:01:15    阅读次数:205
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!