摘要: #include "stdafx.h"#include #include int const count=10;typedef struct { int key;}records;typedef records list[count+1];void BubbleSort(list & r){ bool flag=1; //最多需要比较n-1次 for(int i=1;ir[... 阅读全文
posted @ 2007-08-07 16:09 吴东雷 阅读(248) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include #include int const count=8;typedef struct { int key;}records;typedef records list[count+1];//此处没有使用书中的算法,书中的算法实现很繁索,且使用i,h,j,p,x一类的变量,使程序阅读更加吃力//我实现的是严蔚敏版的数据结构中关于快速排序的算法... 阅读全文
posted @ 2007-08-07 16:09 吴东雷 阅读(295) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include #include int const count=10;typedef struct { int key;}records;typedef records list[count+1];void straightsort(list & r){ for(int i=2;i>r[i+1].key; } cout<<"输入的序... 阅读全文
posted @ 2007-08-07 10:14 吴东雷 阅读(274) 评论(0) 推荐(0) 编辑