折半查找算法在顺序表中插入一个元素讲解.pdfVIP

  • 106
  • 0
  • 约1.55千字
  • 约 3页
  • 2021-06-25 发布于湖南
  • 举报

折半查找算法在顺序表中插入一个元素讲解.pdf

折 半 查 找 算 法 在 顺 序 表 中 插 入 一 个 元 素 精品资料 // 利用折半查找算法在一个有序表中插入数据 x 并保持表的有序性 #include stdio.h #define MAXSIZE 30 #include iostream #include string.h using namespace std; int x; typedef struct //顺序表 { int key; //关键字 }SeqList; int main(void) { int i,n; SeqList R[MAXSIZE]; // 建立存放顺序表的数组 cout请输入表元素个数 nendl; cinn; cout请输入顺序表关键字与元素 endl; for(i=0;in;i++) { cinR[i].key; } cout请输入插入元素 xendl;

文档评论(0)

1亿VIP精品文档

相关文档