顺序表有序插入数据

#include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct { int data[8]; int length; }SqNode; int FindEle(SqNode &L,int x){ int j=0; for (; j < L.length; ++j) { if (x<L.data[j]){ printf("%d",j); return j; } } return j; } int main(){ SqNode sqNode={ {1,2,3,4,5,6,7,8}, 8 }; FindEle(sqNode,3); return 0; }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpsfys.html