struct ListNode { int m_nKey; ListNode *m_pNext;};void printListReversingly(ListNode *pHead) { stack nodes; ListNode *pNode = pHead; while (pNode != N...
分类:
其他好文 时间:
2014-09-26 11:42:08
阅读次数:
162
swap分区的用处:swap是当物理内存不够用的时候,把数据放到swap中,所以swap起到了一个虚拟内存的作用,在某种意义上来说也算是加大了内存空间。一般swap分区是在安装系统时设置的,如果安装系统时忘记分swap分区了,那也没事,还有补救的方法。下面就讲讲安装完系统后如何添..
分类:
系统相关 时间:
2014-09-26 11:21:10
阅读次数:
254
swap分区的用处:swap是当物理内存不够用的时候,把数据放到swap中,所以swap起到了一个虚拟内存的作用,在某种意义上来说也算是加大了内存空间。一般swap分区是在安装系统时设置的,如果安装系统时忘记分swap分区了,那也没事,还有补救的方法。下面就讲讲安装完系统后如何添加swap分区。...
分类:
系统相关 时间:
2014-09-26 10:42:38
阅读次数:
269
阶段三:我们这次试一下非正常退出模拟宕机方法:方法一:虚拟机挂起方法二:echoc>/proc/sysrq-trigger恢复所有节点(略)[root@web1~]#cman_toolstatus……Nodes:4Expectedvotes:8Totalvotes:8Nodevotes:2Quorum:5……=====Step1:对web3节点进行模拟故障=====[root@web1~..
分类:
其他好文 时间:
2014-09-26 00:15:48
阅读次数:
326
题目链接 https://icpcarchive.ecs.baylor.edu/external/65/6514.pdf题意:给出n个数(n a[max(i,j)]) swap(a[i], a[j]) ;}//Carlos's Codewhile (!sorted(a)) { int i...
分类:
其他好文 时间:
2014-09-25 21:45:07
阅读次数:
244
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 1 /** 2 ...
分类:
其他好文 时间:
2014-09-25 13:02:08
阅读次数:
204
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].思路:...
分类:
其他好文 时间:
2014-09-25 03:56:48
阅读次数:
215
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].思路...
分类:
其他好文 时间:
2014-09-24 22:57:37
阅读次数:
187
【求最大深度】Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
这里说的最大深度是指最深叶子节点到根节点的路径长度
...
分类:
其他好文 时间:
2014-09-24 16:09:37
阅读次数:
200
1 #include 2 using namespace std; 3 4 5 void swap(int& x,int& y) 6 { 7 y = x + y; 8 x = y - x; 9 y = y - x;10 }11 12 int _tmain(int ar...
分类:
其他好文 时间:
2014-09-24 14:18:37
阅读次数:
175