码迷,mamicode.com
首页 >  
搜索关键字:swap    ( 4231个结果
堆排序及其相关操作
这里记录下堆的相关操作。 op 1: ''' @ data: the heap array @ p : index of parent item @ n : number of data @@ Swap p and it's son items, make p the largest of them ''' def swapForMaxHeap(data, n, p): l...
分类:其他好文   时间:2014-07-13 17:07:15    阅读次数:223
快速排序
1 #include 2 #include 3 #include 4 using namespace std; 5 6 void swap(int *a, int *b){ 7 int tmp; 8 tmp = *a; 9 *a = *b;10 *b = tmp;...
分类:其他好文   时间:2014-07-13 13:11:27    阅读次数:190
Leetcode:Swap Nodes in Pairs 单链表相邻两节点逆置
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-07-12 20:39:17    阅读次数:225
Learn ZYNQ(10) – zybo cluster word count
1.配置环境说明 spark:5台zybo板,192.168.1.1master,其它4台为slave hadoop:192.168.1.1(外接SanDisk ) 2.单节点hadoop测试: 如果出现内存不足情况如下: 查看当前虚拟内存容量: free -m cd /mnt mkdir swap...
分类:其他好文   时间:2014-07-11 11:38:44    阅读次数:407
JMeter—丰富报表功能PerfMon插件
可能有童鞋不知道PerfMon插件是干啥的,这里简要说一下: 在做负载测试时,我们要时刻关注服务器的CPU,MEM……的使用情况,但是JMeter本身对这些信息是不做收集的,这个时候PerfMon就应运而生了。没错,他就是用来收集被压服务器的各种性能指标,例如: CPU, Memory, Swap, Disks I/O and Networks I/O …… 进入正题: 环境...
分类:其他好文   时间:2014-07-10 21:09:11    阅读次数:327
Effective C++ Item 25 考虑写出一个不抛异常的swap函数
经验:当std::swap对你的类型效率不高时,提供一个swap成员函数,并确定这个函数不抛出异常 示例: stl里的swap算法 namespace std{ template void swap(T &a, T &b){ T temp(a); a = b; b = temp; } } //“pimpl手法”(pointer to implementation) --> 文件间的编译依存度 class WidgetImpl{ public: //... pr...
分类:编程语言   时间:2014-07-10 19:35:50    阅读次数:240
c++ 类中模版成员函数
C++函数模版与类模版。template void SwapFunction(T &first, T &second){}//函数模版template //类模版class CTemplate{public: void SWap(T &first, T &second){ }};#include.....
分类:编程语言   时间:2014-07-09 16:50:30    阅读次数:210
[LeetCode]Swap Nodes in Pairs
[LeetCode]Swap Nodes in Pairs...
分类:其他好文   时间:2014-07-08 20:40:15    阅读次数:161
【LeetCode】Swap Nodes in Pairs
题目 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 spac...
分类:其他好文   时间:2014-07-08 13:46:26    阅读次数:205
解决编译GCC内存不足的错误
近期在使用阿里和腾讯的云服务器,由于只是测试用所以只租用了廉价512的内存,在编译gcc时遇到错误,表面上看只是编译错误,并且原因不明,纠结了几次之后猜测应该是由于系统资源不足导致的,所以尝试增加系统的swap分区,这里需要检查两个地方一、修改swappiness1.查看你的系统里面的swappin...
分类:其他好文   时间:2014-07-05 22:34:24    阅读次数:396
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!