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)

导航