2015年6月24日

希尔排序

摘要: 1 /* 希尔排序 */ 2 3 #include 4 #include 5 6 void show(int *p,int length) 7 { 8 printf("\n"); 9 for (int i=0;i=1)// 增量终止的条件19 {20 f... 阅读全文

posted @ 2015-06-24 14:40 Dragon-wuxl 阅读(196) 评论(0) 推荐(0)

堆排序

摘要: 1 /* 堆和堆排序 */ 2 3 // 堆排序 查找最大值 最小值速度最快 4 // 数据结构里面的堆 主要是取出极值 5 6 #include 7 #include 8 9 void show(int *p,int n)10 {11 12 for(int i=0;i0... 阅读全文

posted @ 2015-06-24 12:55 Dragon-wuxl 阅读(227) 评论(0) 推荐(0)

插入排序

摘要: 1 /* 插入排序 */ 2 3 #include 4 #include 5 6 void main() 7 { 8 int a[10]={1,2,3,4,6,7,8,9,10,5}; 9 int temp=a[9];// 元素 5 10 int j=9;// 记录下标... 阅读全文

posted @ 2015-06-24 10:20 Dragon-wuxl 阅读(192) 评论(0) 推荐(0)

拉格朗日插值查找

摘要: /* 拉格朗日插值查找 */#include#include#define N 1024void search(int a[N],int num){ int tou = 0; int wei = N-1; int zhong; int flag = -1;// 代表找不到 ... 阅读全文

posted @ 2015-06-24 09:18 Dragon-wuxl 阅读(167) 评论(0) 推荐(0)

二分查找

摘要: 1 /* 二分查找 */ 2 3 #include 4 #include 5 #define N 1024 6 7 void search(int a[N],int num) 8 { 9 int tou = 0;10 int wei = N-1;11 int zhong... 阅读全文

posted @ 2015-06-24 09:06 Dragon-wuxl 阅读(182) 评论(0) 推荐(0)

2015年6月20日

斐波那契数组数组法

摘要: 1 /* 斐波那契数组数组法 */ 2 3 #include 4 #include 5 6 // 1 1 2 3 5 8 7 8 int get(int i)// 递归 9 {10 if (i==1 || i==2)11 {12 return 1;... 阅读全文

posted @ 2015-06-20 16:16 Dragon-wuxl 阅读(410) 评论(0) 推荐(0)

冒泡排序

摘要: 1 /* 冒泡排序最大值沉底 */ 2 3 #include 4 #include 5 6 7 8 void main() 9 {10 int a[10] = {3,5,18,9,23,5,2,1,0,2};11 for (int i=0;i a[i+1])// 对比14 ... 阅读全文

posted @ 2015-06-20 10:48 Dragon-wuxl 阅读(190) 评论(0) 推荐(0)

选择排序

摘要: 1 /* 数组实战 */ 2 3 #include 4 #include 5 #include 6 7 void main() 8 { 9 // 越界不一定出错,不越界一定不会发生内存访问冲突 10 int a[5]={1,2,3,4,5}; 11 f... 阅读全文

posted @ 2015-06-20 09:46 Dragon-wuxl 阅读(189) 评论(0) 推荐(0)

快速排序

摘要: 1 #include 2 #include 3 4 void swap(int * pi, int *pj)//交换 5 { 6 int temp = *pi; 7 *pi = *pj; 8 *pj = temp; 9 } 10 void show... 阅读全文

posted @ 2015-06-20 07:49 Dragon-wuxl 阅读(167) 评论(0) 推荐(0)

2015年6月17日

CGI后门服务器开发

摘要: 1 /* 服务器开发 */ 2 3 #include 4 #include 5 #include 6 // 重定向输出 7 // 输入 8 void main() 9 { 10 printf("Content-type:text/html\n\n"); 11 ... 阅读全文

posted @ 2015-06-17 15:49 Dragon-wuxl 阅读(284) 评论(0) 推荐(0)

导航