正在加载图片...
插入算法的框图请见教材P14,下面给出C函数 struct ist /结构类型 { int V MAXNE;/*整型数组,MAXN为预估数组容量* int n; /表长 typedef struct list LIST;/定义LNT为上述结构类型* int sqinsert(p,i, x) LIST *P; /指向结构类型的指针 int l, x; /i为插入位置,x为被插入元素* f int j if(p>n<=0) { printf(“表长错误Ⅷ”); return(-1)插入算法的框图请见教材P.14, 下面给出C函数. struct list /* 结构类型*/ { int v[MAXN]; /* 整型数组, MAXN为预估数组容量*/ int n; /* 表长 */ }; typedef struct list LIST; /* 定义LIST为上述结构类型*/ int sqinsert(p,i,x) LIST *p; /* 指向结构类型的指针 */ int i,x; /* i为插入位置, x为被插入元素*/ { int j; if (p->n<=0) { printf(“表长错误\n ”); return(-1); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有