码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
链表反向输出
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
Linux/centos 装完系统后添加SWAP分区
swap分区的用处:swap是当物理内存不够用的时候,把数据放到swap中,所以swap起到了一个虚拟内存的作用,在某种意义上来说也算是加大了内存空间。一般swap分区是在安装系统时设置的,如果安装系统时忘记分swap分区了,那也没事,还有补救的方法。下面就讲讲安装完系统后如何添..
分类:系统相关   时间:2014-09-26 11:21:10    阅读次数:254
Linux/centos 装完系统后添加SWAP分区
swap分区的用处:swap是当物理内存不够用的时候,把数据放到swap中,所以swap起到了一个虚拟内存的作用,在某种意义上来说也算是加大了内存空间。一般swap分区是在安装系统时设置的,如果安装系统时忘记分swap分区了,那也没事,还有补救的方法。下面就讲讲安装完系统后如何添加swap分区。...
分类:系统相关   时间:2014-09-26 10:42:38    阅读次数:269
RHCS(三)之quorum机制测试(阶段三、四、结论)
阶段三:我们这次试一下非正常退出模拟宕机方法:方法一:虚拟机挂起方法二: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
UVALive 6514:Crusher’s Code(概率dp)
题目链接 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 Lists
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
leetcode - [7]Binary Tree Preorder Traversal
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
leetcode - [6]Binary Tree Postorder Traversal
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!