码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
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?Analysis: typical Runner Technique. 一次过 1 ...
分类:其他好文   时间:2014-06-28 13:44:51    阅读次数:164
Leetcode: Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?一次...
分类:其他好文   时间:2014-06-28 13:38:14    阅读次数:171
[LeetCode] 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-28 13:23:40    阅读次数:150
leetcode - Flatten Binary Tree to Linked List
题目:Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 ...
分类:其他好文   时间:2014-06-24 09:09:02    阅读次数:147
LeetCode Linked List Cycle II
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:其他好文   时间:2014-06-22 23:59:58    阅读次数:244
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->3->3->4->4->5, return 1->2->5. Given 1->1-...
分类:其他好文   时间:2014-06-22 22:57:49    阅读次数:347
【Leetcode】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...
分类:其他好文   时间:2014-06-22 20:02:46    阅读次数:182
LeetCode::Sort List 详细分析
Sort a linked list in O(n log n) time using constant space complexity. 这道题目非常简短的一句话,给链表排序,看到nlogn,我们可以来简单复习一下排序。首先说一下这个nlogn的时间复杂度(根据决策树我们可以得出这个界限),是基于比较排序的最小上限,也就是说,对于没有一定范围情况的数据来说,最快的排序思路就是归并和快速排...
分类:其他好文   时间:2014-06-22 09:02:54    阅读次数:250
leetcode__Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search Tree  Total Accepted: 12283 Total Submissions: 45910My Submissions Given a singly linked list where elements are sorted in ascending order, convert it...
分类:其他好文   时间:2014-06-21 23:57:00    阅读次数:351
LeetCode解题报告:Linked List Cycle && Linked List Cycle II
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Linked List Cycle IIGiven...
分类:其他好文   时间:2014-06-20 20:46:58    阅读次数:245
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!