码迷,mamicode.com
首页 >  
搜索关键字:linked    ( 5490个结果
[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 s...
分类:其他好文   时间:2014-07-03 21:00:48    阅读次数:401
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-07-03 20:32:55    阅读次数:429
[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.
分类:其他好文   时间:2014-07-03 19:10:40    阅读次数:201
删除顺序链表中重复的数 (一) leecode
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-07-03 18:57:04    阅读次数:193
Leetcode Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.合并k个排序列表解题思路是:取出 k个元素进行堆排序,每次取出最小的元素,插入链表中即可注意本题利用了c++...
分类:其他好文   时间:2014-07-02 20:16:54    阅读次数:273
[leetcode] Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.
分类:其他好文   时间:2014-07-02 20:12:57    阅读次数:182
LeetCode: Sort List [148]
【题目】 Sort a linked list in O(n log n) time using constant space complexity. 【题意】 排序一个链表,要求时间复杂度O(nlogn),使用常量空间 【思路】 nlogn的复杂度,用归并排序求解...
分类:其他好文   时间:2014-07-02 09:25:40    阅读次数:252
Leetcode:Sort List 对单链表归并排序
Sort a linked list in O(n log n) time using constant space complexity. 看到O(n log n)的排序算法,适合单链表的首先想到的就是归并排序 /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis...
分类:其他好文   时间:2014-07-02 08:47:34    阅读次数:239
LeetCode: Insertion Sort List [147]
【题目】 Sort a linked list using insertion sort. 【题意】 用插入排序方法排序链表 【思路】 直接搞...
分类:其他好文   时间:2014-07-02 08:33:49    阅读次数:200
Leetcode: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. 代码如下: * Definition for singly-linked list. * struct L...
分类:其他好文   时间:2014-07-02 07:23:59    阅读次数:159
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!