PROGRAM_MAX_LENGTH = 60*60*3 #3 hoursskiptimes = 0TOTALTIMES = 0def xxx(): print TOTALTIMES #fine consider it as constant #TOTALTIMES += 1 #N...
分类:
编程语言 时间:
2014-06-28 12:47:52
阅读次数:
294
通常struts.xml都是如下形式: struts元素下有五个元素,只讲解package、constant、include;package: 在Struts2框架中是通过包来管理action、result、interceptor、interceptor-stack等配置信息的。属性:n...
分类:
其他好文 时间:
2014-06-22 23:29:51
阅读次数:
296
Sort a linked list in O(n log n)
time using constant space complexity.
这道题目非常简短的一句话,给链表排序,看到nlogn,我们可以来简单复习一下排序。首先说一下这个nlogn的时间复杂度(根据决策树我们可以得出这个界限),是基于比较排序的最小上限,也就是说,对于没有一定范围情况的数据来说,最快的排序思路就是归并和快速排...
分类:
其他好文 时间:
2014-06-22 09:02:54
阅读次数:
250
在Bootstrap中使用
$url = constant ( "APPLICATION_PATH" ) . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'application.ini';
$dbconfig = new Zend_Config_Ini ( $url, "mysql" );
// $db = Zen...
分类:
数据库 时间:
2014-06-22 07:52:08
阅读次数:
205
Sort a linked list inO(nlogn) time using constant space complexity.本题利用归并排序即可归并排序的核心是将两部分合成一部分,故开始要将链表分成两部分,利用快慢两个指针,当快指针跑到链表尾部时,慢指针恰好在中间,故可以将链表分成两部分然...
分类:
其他好文 时间:
2014-06-21 12:20:11
阅读次数:
188
foo = $foo; $this->sss = $sss; } function showConstant() { //声明一个成员方法并在其内部访问本类中的常量 echo self::CONSTANT.""; //使用se...
分类:
其他好文 时间:
2014-06-20 16:09:59
阅读次数:
296
mutalbe的中文意思是“可变的,易变的”,跟constant(既C中的const)是反义词。 在C 中,mutable也是为了突破const的限制而配置的。被mutable修饰的变量,将永远处于可变的状态,即使在一个const函数中。 我们知道,假如类的成员函数不会改变对象的状态,那么这个成.....
分类:
其他好文 时间:
2014-06-20 14:21:22
阅读次数:
200
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Could you devise a constant space solution?
思路:因为需要遍历整个矩阵,时间复杂度肯定需要O(m * n),对于空间复杂度而言,第一种是可以使用O(m * n),...
分类:
其他好文 时间:
2014-06-18 12:33:39
阅读次数:
167
Question:Sort a linked list inO(nlogn) time
using constant space complexity.Solution:Merge sort.找到链表的中间的那个ListNode. 1 /** 2
* Definition for singly-l....
分类:
其他好文 时间:
2014-06-12 17:59:34
阅读次数:
285