数据结构算法学习课件.pptVIP

  • 4
  • 0
  • 约 105页
  • 2016-12-06 发布于江苏
  • 举报
数据结构算法 Visual C++ 6.0程序集 侯 识 忠 等编著 中国水利水电出版社 7、1 插入排序法(类方法) //插入排序法(类方法)charufa1.cpp #includeiostream.h #includeiomanip.h #includetime.h #includestdlib.h #define MAXI 10 typedef int KeyType; typedef int ElemType; struct rec { KeyType key;ElemType data;}; typedef rec sqlist[MAXI]; class charu {public: charu(sqlist a,int m):n(m) {for(int i=0;in;i++) b[i]=a[i];} void insertsort() {int i,j,k; for(i=1;in;i++) {rec d=b[i]; 单击此处运行程序 charu px(a1,10); cout排序前数组:\n; px.output(); cout数组排序过程演示:\n; px.insertsort(); cout排序后数组:\n; px.output();cin.get();} 7、2 插入排序法(类方法) //插入排序法(类方法)

文档评论(0)

1亿VIP精品文档

相关文档