使用分区做为SWAP比较好,速度比文件的快,也不容易产生磁盘碎片所有应该尽量使用分区作为SWAP. 先说说使用文件做为SWAP吧:一、因为做为SWAP的文件,必须是连续的,所以需要使用dd命令创建:[root@NEWLFS ~]#dd if=/dev/zero of=swapfile bs=1024...
分类:
其他好文 时间:
2014-10-29 12:33:50
阅读次数:
184
相 信大家看到swap这个词都一定不会感到陌生,甚至会有这样想法:这不就是简单的元素交换嘛。的确,swap交换函数是仅次于Hello word这样老得不能老的词,然而,泛型算法东风,这个小小的玩意儿却在C++ STL中散发着无穷的魅力。本文不仅详细地阐述STL泛型算法swap,并借助泛型算法这股东风...
分类:
其他好文 时间:
2014-10-29 08:01:39
阅读次数:
317
对于Linux的虚拟内存的理解,这个例子算是一个很好的引导了,原文链接:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=26683523&id=3201345
《Linux内核设计与实现》15章节给出的例子更详细些。
*********************************************************...
分类:
系统相关 时间:
2014-10-28 17:59:13
阅读次数:
308
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of...
分类:
其他好文 时间:
2014-10-28 10:29:07
阅读次数:
204
Ubuntu 12.04 分区方案(仅供参考)总空间大小:50G目录建议大小实际大小格式描述/10G~20G10Gext4根目录swap<2048M1Gswap交换空间/boot200M左右100Mext4Linux的内核及引导系统程序所需要的文件,比如 vmlinuz initrd.img文件都位...
分类:
系统相关 时间:
2014-10-28 02:04:51
阅读次数:
290
public class PermutationAndCombination { /// /// 交换两个变量 /// /// 变量1 /// 变量2 public static void Swap(ref T a, ref T b) { T temp = a; a = b; b = temp;.....
分类:
编程语言 时间:
2014-10-27 19:17:47
阅读次数:
262
全排列是非常常用的一个小算法,下面是n个整数全排列的递归实现,使用的是C++
#include
using namespace std;
int n = 0;
void swap(char *a ,char *b)
{
int m ;
m = *a;
*a = *b;
*b = m;
}
void perm(char list[],int k, int m )
{
int...
分类:
编程语言 时间:
2014-10-27 10:58:40
阅读次数:
208
A function can return any number of results.This function returns two strings.package mainimport "fmt"func swap(x, y string) (string, string) { ret...
分类:
其他好文 时间:
2014-10-26 21:00:32
阅读次数:
143
有两个变量 a 和 b ,交换这两个变量的值方法一 使用中间变量void swap(int *a, int *b){ int temp = 0; temp = *a; *a = *b; *b = temp; }方法二 不适用任何中间变量 ① 异或运算法void swap...
分类:
其他好文 时间:
2014-10-26 13:05:02
阅读次数:
149
1,进程的虚拟内存:背景知识a.out分段以及运行时候内存的结构点击打开链接linux进程地址空间linux进程地址空间\[cpp]view plaincopystructmm_struct{structvm_area_struct*mmap;/*listofmemoryareas*/structr...
分类:
系统相关 时间:
2014-10-26 09:06:43
阅读次数:
224