源码://HeapSort.cpp#include using namespace
std;//about heap://the last leaf node is a[n-1]//the last non-leaf node is
a[n/2-1];// a[i]// ...
分类:
其他好文 时间:
2014-05-27 02:21:23
阅读次数:
240
算法源码://BubbleSort.cpp#include using namespace
std;void BubbleSort(int a[], int n){ for(int i=n-1;i>0;i--) { for(int
j=0;ja[j+1]) { int tmp = a[j...
分类:
其他好文 时间:
2014-05-27 02:07:07
阅读次数:
223
#include
"HelloWorldScene.h"USING_NS_CC;CCScene* HelloWorld::scene(){ CCScene *scene =
CCScene::create(); HelloWorld *layer = HelloWorld::create...
分类:
其他好文 时间:
2014-05-27 02:06:26
阅读次数:
221
题意:对于n,m,k,定义n的操作,+m,-m,*m,%m,(You should know that
if a = b * q + r (q > 0 and 0 3 #include 4 #include 5 #include 6 #include 7
using namespace s...
分类:
其他好文 时间:
2014-05-27 01:39:48
阅读次数:
285
echo -e "#include \nint main()\n{\n printf(\"hello
world\\\n\");\n return 0;\n}" > h.c; gcc h.c; ./a.outh.c里的内容#include int
main(){ printf("h...
分类:
其他好文 时间:
2014-05-24 07:34:05
阅读次数:
213
最近看数据结构时看到直接插入排序法,其基本思想是:将一个记录插入到已经排好序的有序表中,从而得到一个新的,记录数增1的有序表下面是代码实现与测试 1
#include 2 using namespace std; 3 void InsertSort(int *q,int L) 4 { 5 ...
分类:
其他好文 时间:
2014-05-24 07:07:19
阅读次数:
285
#include#include#includeusing namespace std;const
int N = 10;int helper(int* a,const int num1,const int num2){ int i=1; int j=1;
for(int m = 0;m te...
分类:
其他好文 时间:
2014-05-24 06:17:01
阅读次数:
222
归并排序#define LOCAL#include#include
//生成随机数c++11支持 #include #include #includeusing namespace std;int const
MAX_N=10;int a[MAX_N],b[MAX_N],c[2*MAX_N];//归...
分类:
其他好文 时间:
2014-05-24 06:01:45
阅读次数:
354
pthread_join 函数是会阻塞主线程的,这会让很多java程序员不适应。因为在java中
start以后一个线程就执行执行了。主线程不会被阻塞。而在linux中 join是会阻塞的。那么如何使用join的时候
不阻塞主线程呢。我给出了一个解决方法。#include #include void...
分类:
编程语言 时间:
2014-05-24 05:59:40
阅读次数:
571
std::fill 在[first, last)范围内填充值#include #include
#include int main(){ std::vector v; v.resize(10); std::fill(v.begin(), v.end(),
100); retu...
分类:
编程语言 时间:
2014-05-24 05:15:36
阅读次数:
320