Question: Mergeksorted linked lists and return
it as one sorted list. Analyze and describe its complexity.Solution: Find the
smallest list-head first....
分类:
其他好文 时间:
2014-06-10 19:51:30
阅读次数:
278
当你Eclipse环境中改动项目中的某个方法时,你可能因为各种原因没有执行单元測试,结果代码提交,悲剧就可能随之而来。所幸infinitest(http://infinitest.github.io/)提供了一个Continuous
Testing插件,以及时自己主动执行单元測试。尽管会多占一些CP...
分类:
系统相关 时间:
2014-06-10 13:23:24
阅读次数:
316
结构体: 关系密切但数据类型不尽相同,常指针和常量指针的区别:char * const cp
: 定义一个指向字符的指针常数,即const指针,常指针。const char* p : 定义一个指向字符常数的指针,即常量指针。char const* p :
等同于const char* p[2]。理解...
分类:
编程语言 时间:
2014-06-10 11:34:12
阅读次数:
235
dir1下有个log_1.log dir2下有个log_2.log 两个文件如下:
p_ylwu@VM_194_111_sles10_64:/home/jdxochen/exercise> cat -v dir1/log_1.log
1
3
5
7
9
0
p_ylwu@VM_194_111_sles10_64:/home/jdxochen/exercise> cat -v di...
分类:
系统相关 时间:
2014-06-10 11:04:29
阅读次数:
265
问题:
给定个单链表,判断该链表是否存在环。
分析:
这个问题是见的非常多的题目,问题本身而言,技巧性很强,或者说思路很巧妙,这里要说的不是这个题目本身,而是说这种技巧,在很多的地方是用的到的,比如,在寻找单链表的中间节点的时候,就可以用这种形式,一个走两步,一个走一步的形式,来获得中间节点。
//
bool hasCycle(ListNode *head) {
if(...
分类:
其他好文 时间:
2014-06-10 10:48:49
阅读次数:
176
1、查看所有用户名 cat /etc/passwd |cut -f 1 -d
#是1不是L的小写2、显示用户信息whoami 查看当前登录用户名。id username 查看用户的uid,gid和组名。groups username
查看用户username所在的组及组内成员。groups 查看当....
分类:
系统相关 时间:
2014-06-10 10:04:05
阅读次数:
280
问题:
给定一个有序链表,生成对应的平衡二叉搜索树。
分析
见Convert
Sorted Array to Binary Search Tree
实现:
TreeNode *buildTree(ListNode* head, ListNode *end){
if(head == NULL || head == end)
return NULL;
...
分类:
其他好文 时间:
2014-06-10 07:17:29
阅读次数:
264
题目
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
方法
...
分类:
其他好文 时间:
2014-06-10 06:12:06
阅读次数:
285
在bbs.html5china.com论坛学习了MV和老马的小熊蘑菇后我也自己模仿他们做了这样子一个游戏,权当技术交流学习,现在附上游戏截图和源码。游戏截图:1、系统菜单界面:2、游戏界面3、游戏结束界面:4、游戏设置页面这是一款休闲型的游戏,移动方块,相同的方块在一起就会消除,计算消除整个屏幕方块...
分类:
Web程序 时间:
2014-06-09 17:44:06
阅读次数:
245
ssh narnia4@narnia.labs.overthewire.org 然后输入密码:XXOO
cat narnia4.c #include #include #include #include extern char **environ;int
main(int argc,char **a...
分类:
其他好文 时间:
2014-06-09 16:50:12
阅读次数:
370