排序 数据结构.docxVIP

  • 0
  • 0
  • 约3.54千字
  • 约 5页
  • 2023-02-02 发布于江苏
  • 举报
includestdio.h includestdlib.h define Max 100 //假设文件长度 typedef struct{ //定义记录类型int key; }RecType; typedef RecType SeqList[Max+1]; int n; //直接插入排序法 void InsertSort(SeqList R) { int i,j; for(i=2;i=n;i++) if(R[i].keyR[i-1].key){ R[0]=R[i];j=i-1; do { R[j+1]=R[j]; j--; }while(R[0].keyR[j].key); R[j+1]=R

文档评论(0)

1亿VIP精品文档

相关文档