看到const 关键字,C++程序员首先想到的可能是const 常量。这可不是良好的条件反射。如果只知道用const 定义常量,那么相当于把火药仅用于制作鞭炮。const 更大的魅力是它可以修饰函数的参数、返回值,甚至函数的定义体。
const 是constant 的缩写,“恒定不变”的意思。被const 修饰的东西都受到强制保护,可以预防意外的变动,能提高程序的健壮性。所以很多C++程序设...
分类:
其他好文 时间:
2014-11-27 22:08:54
阅读次数:
193
常量是一个简单值的标识符(名字)。如同其名称所暗示的,在脚本执行期间该值不能改变(除了所谓的魔术常量,它们其实不是常量)。常量默认为大小写敏感。通常常量标识符总是大写的。 ????可以用 de...
分类:
Web程序 时间:
2014-11-27 14:44:58
阅读次数:
233
Sort a linked list in O(n log n) time using constant space complexity.Analsys:We use Merge Sort.NOTE: We should practice other sort algorithm, linke Q...
分类:
其他好文 时间:
2014-11-27 01:35:39
阅读次数:
213
Sort a linked list in O(n log n) time using constant space complexity....
分类:
编程语言 时间:
2014-11-26 16:37:32
阅读次数:
172
HDFSFederation是为解决HDFS单点故障而提出的NameNode水平扩展方案,该方案允许HDFS创建多个Namespace以提高集群的扩展性和隔离性。在Federation中新增了block-pool的概念,block-pool就是属于单个Namespace的一组block,每个DataNode为所有的block-pool存储block,可以理解bloc..
分类:
其他好文 时间:
2014-11-25 19:03:31
阅读次数:
253
leetcode Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stac...
分类:
其他好文 时间:
2014-11-25 12:31:30
阅读次数:
129
【扩展知识5】谈const有关的那些事
扩展目录:
1. const修饰变量
2. conts 修饰参数
3. const修饰函数返回值
( 1 )const的目的
const是constant的缩写,是恒定不变的意思。但在C语言中修饰的变量是只读的变量,其值在编译时不能被使用,因为编译器在编译时不知道其的存储的内容。
推...
分类:
其他好文 时间:
2014-11-25 09:18:28
阅读次数:
159
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 space. Y...
分类:
编程语言 时间:
2014-11-24 10:10:53
阅读次数:
155
Sort a linked list in O(n log n)
time using constant space complexity.
大家看完题目估计跟我一样啦。。。都在想哪些是nlogn啊~快速排序、归并排序、堆排序!然后开始愁,这些东西变成list了可怎么办啊。。。
可是我深深地记得在CMU的时候老师告诉我,java现在自带的Arrays.sort用的是快排,然后我就想,那么…...
分类:
编程语言 时间:
2014-11-24 10:10:04
阅读次数:
170
转:http://blog.csdn.net/qinyu0109/article/details/7257332struts配置文件的constant的name值在struts2-core-2.1.6.jar --> org.apache.struts2 -->default.properties里...
分类:
其他好文 时间:
2014-11-24 08:40:10
阅读次数:
179