request_mem_region仅仅是linux对IO内存的管理,意思指这块内存我已经占用了,别人就不要动了,也不能被swap出去。使用这些寄存器时,可以不调用request_mem_region,但这样的话就不能阻止别人对他的访问了。http://blog.csdn.net/skyflying...
分类:
其他好文 时间:
2014-10-01 10:16:01
阅读次数:
195
题目大意:输入一个字符串,输出它的下一个字典序排列。
字典序算法思想:
1.从右向左寻找字符串找出第一个a[i]
2.从右向左找出第一个大于a[j]的元素a[i];
3.swap(a[i],a[j])
4.将a[i]......到a[stelen(a)]倒序
5.输出a
代码如下:
#include
#include
#include
#include
#include
usin...
分类:
其他好文 时间:
2014-09-30 22:56:00
阅读次数:
235
虚拟机Virtual Box装的Kali Linux,是Debian的发行版本,安装过程不说了,不是硬盘安装也没什么说的,由于是新手所以只有两个分区,一个【/】和一个【swap】 装好之后是xwindow的界面,可以登录,也可以ctrl+alt+F1~F6切换六个文字终端,需要注意的是文字终端登录时...
分类:
系统相关 时间:
2014-09-30 20:57:40
阅读次数:
309
http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/Procedure To Add a Swap File Under LinuxYou need to use the dd command to create swap file. T...
分类:
系统相关 时间:
2014-09-30 16:59:09
阅读次数:
293
用C++模板书写一段序列数组的全部排列
/**
* 书本:【windows程序设计】
* 功能:输出全部的排列情况
* 文件:全排列.cpp
* 时间:2014年9月29日21:52:55
* 作者:cutter_point
*/
#include
using namespace std;
//交换两个元素的函数
template
inline void Swap(Type &a...
分类:
其他好文 时间:
2014-09-30 00:33:47
阅读次数:
344
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2014-09-29 23:36:31
阅读次数:
258
写一个函数交换两个变量的值。C:错误的实现:void swap(int i, int j) { int t = i; i = j; j = t;}因为C语言的函数参数是以值来传递的(pass by value),参数传递时被copy了,所以函数中交换的是复制后的值。正确的实现:指针版:v...
分类:
编程语言 时间:
2014-09-29 11:50:37
阅读次数:
239
增加了逆置迭代器的实现 以及swap功能 完整代码如下: #ifndef VECTOR_H_
#define VECTOR_H_ #include #include #include template class Vector
{
public: typedef T *iterator; typed...
分类:
其他好文 时间:
2014-09-29 04:28:56
阅读次数:
282
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-09-29 01:40:57
阅读次数:
297
代码如下: template void reverse(It begin, It end)
{ while(begin != end) { --end; if(begin != end) std::swap(*begin++, *end); }
} 注意几点: 1.不能一开始...
分类:
其他好文 时间:
2014-09-28 21:37:45
阅读次数:
232