码迷,mamicode.com
首页 >  
搜索关键字:constant    ( 1663个结果
【LeetCode】Swap Nodes in Pairs
题目 Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant spac...
分类:其他好文   时间:2014-07-08 13:46:26    阅读次数:205
[PHP]How to get the system info?
it is much easier to get the same result through PHP because the PHP language offers some global constant variables and built-in functions....
分类:Web程序   时间:2014-07-08 12:48:07    阅读次数:196
Problem Sort List
Problem Description:Sort a linked list inO(nlogn) time using constant space complexity.Solution: 1 public ListNode sortList(ListNode head) { 2 ...
分类:其他好文   时间:2014-07-07 16:48:00    阅读次数:238
Leetcode | Sort List
Sort a linked list in O(n log n) time using constant space complexity.merge sort、heap sort和quick sort都是O(nlgn),但是mergesort和quicksort都是递归的,不是constant s...
分类:其他好文   时间:2014-07-06 21:07:41    阅读次数:210
theano 文档再度笔记
1. automic differentation的含义2. constant folding3. memory aliasing4. broadcasting 是个难点5. shared variable6. function函数7.
分类:其他好文   时间:2014-07-05 17:51:00    阅读次数:325
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-Sort List(Python)
【问题】 Sort a linked list in O(n log n) time using constant space complexity. 【代码】 # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # ...
分类:编程语言   时间:2014-06-28 08:29:23    阅读次数:222
Sort List
Sort a linked list in O(n log n) time using constant space complexity.思路:使用O(nlogn)时间复杂度和常数空间复杂度,我们想到可以用归并排序。1)找到链表中间位置2)将两个链表按序合并链表3)对所给链表进行整体的归并排序/*...
分类:其他好文   时间:2014-06-27 00:22:37    阅读次数:303
深入理解C++中的mutable关键字
mutalbe的中文意思是“可变的,易变的”,跟constant(既C++中的const)是反义词。 在C++中,mutable也是为了突破const的限制而设置的。被mutable修饰的变量,将永远处于可变的状态,即使在一个const函数中。 我们知道,如果类的成员函数不会改变对象的状态,那么.....
分类:编程语言   时间:2014-06-26 21:28:25    阅读次数:283
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!