--常量 常量的定义使用define()函数,获取常量的两种方法一是直接使用常量名,二是使用 constant()函数。判断一个常量是否已经定义了使用defined()函数。 常见的预定义常量: __FILE__:主配置文件路径 PHP_VERSION:当前PHP版本 PHP_OS:当前系统类型--...
分类:
其他好文 时间:
2014-12-13 17:47:35
阅读次数:
121
今天调试代码,碰到expected unqualified-id before numeric constant 错误,代码的错误模块出现在一个函数模块上,奇怪的是这个函数模块之前编译了很多次,也没有被修改过,突出出错了。网上查了下,发现这种错误一般都是在其他的地方有错误,编译器报错的地方却在另外一...
分类:
其他好文 时间:
2014-12-12 11:34:36
阅读次数:
227
毫秒延时函数:mdelay()微妙延时函数:ndelay()1 #ifndef mdelay2 #define mdelay(n) (/3 (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000)...
分类:
系统相关 时间:
2014-12-11 12:08:16
阅读次数:
485
题目
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 ...
分类:
其他好文 时间:
2014-12-10 16:26:18
阅读次数:
123
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6,...
分类:
其他好文 时间:
2014-12-09 21:19:43
阅读次数:
309
1.问题描述 Sort a linked list in O(n log n) time using constant space complexity.2.翻译 在固定的空间复杂度中使用O(nlog n)的时间复杂度进行链表的排序。 3.思路分析 提起排序,我们脑海中会迅速出现各种排序算法...
分类:
其他好文 时间:
2014-12-09 21:06:36
阅读次数:
181
今日leetcode链表题全制霸原题地址:https://oj.leetcode.com/problems/sort-list/题目内容:Sort ListSort a linked list inO(nlogn) time using constant space complexity.方法:题目...
分类:
其他好文 时间:
2014-12-09 17:19:38
阅读次数:
162
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get...
分类:
其他好文 时间:
2014-12-08 23:10:51
阅读次数:
400
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-12-08 19:38:48
阅读次数:
173
Sort a linked list inO(nlogn) time using constant space complexity.时间复杂度为O(nlbn)的排序一般选择归并排序或快速排序,而且链表的归并不需要重新分配空间,也只需要常量的空间。一下是链表的归并排序实现: 1 ListNode *...
分类:
其他好文 时间:
2014-12-06 16:40:11
阅读次数:
168