上一页 1 ··· 9 10 11 12 13 14 下一页
摘要: 1 #include 2 3 void Qsort(int a[],int low,int high) 4 { 5 if(low>=high) 6 return; 7 int first=low; 8 int last=high; 9 in... 阅读全文
posted @ 2015-03-26 15:05 薛晓东 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 int* selectionSort(int datas[], int size) 4 { 5 int* temp = new int[size]; 6 int f,k; 7 for(int i=0;i<size;i++) 8 { ... 阅读全文
posted @ 2015-03-26 13:22 薛晓东 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 int* mergeSort(int data1[], int data2[], int size1, int size2) 4 { 5 int* temp = new int[size1+size2]; 6 int i = 0,j = 0, t=... 阅读全文
posted @ 2015-03-25 18:21 薛晓东 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 二分法查找 3 查找有序数组datas中数字number在第几位 4 若datas[j]=number,则返回j;如果不存在j使datas[j]=number,则返回-1; 5 */ 6 int binarySearch(int datas[],int size,int ... 阅读全文
posted @ 2015-03-24 16:50 薛晓东 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1 int* insertionSort(int datas[],int len) 2 { 3 int* temp = new int[len];// 定义一个指向数组的指针 4 int i,x; 5 6 for(int j=1;j=0)11 {12 ... 阅读全文
posted @ 2015-03-24 16:47 薛晓东 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1 int* insertionSort(int datas[],int len) 2 { 3 int* temp = new int[len];// 定义一个指向数组的指针 4 int i,x; 5 6 for(int j=1;j=0)11 {12 ... 阅读全文
posted @ 2015-03-24 16:17 薛晓东 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 void function(int datas[],int len) 4 { 5 for(int j=0;j<len;j++) 6 { 7 cout << datas[j] << endl; 8 } 9 }10 11 int... 阅读全文
posted @ 2015-03-24 15:02 薛晓东 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 int main(int argc, char* argv[]) 5 { 6 cout usingnamespacestd;floatFuncP(inta,floatb){returna+b;}intFuncNP(){return3... 阅读全文
posted @ 2015-03-24 11:12 薛晓东 阅读(120) 评论(0) 推荐(0) 编辑
摘要: There are five data types for C: void, integer, float, double, and char.TypeDescriptionvoidassociated with no data typeintintegerfloatfloating-point n... 阅读全文
posted @ 2015-03-24 10:27 薛晓东 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 整型 1,在java中,整型的范围与运行java代码的机器无关,从而解决在不同平台之间移植的问题。例如:byte型占1个字节,short型占2个字节,int型占4个字节,long型占8个字节。相反,在C或者C++中,程序会根据不同的处理器现则最为有效的整型。这也是C++效率较高的一个原因。 2,在j... 阅读全文
posted @ 2015-03-23 17:44 薛晓东 阅读(1231) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 下一页