- 18
- 0
- 约1.48万字
- 约 17页
- 2017-08-14 发布于安徽
- 举报
数据结构C语言实现系列——线性表
#include stdio.h#include stdlib.htypedef int elemType;/************************************************************************//* 以下是关于线性表顺序存储操作的16种算法 *//************************************************************************/struct List{ elemType *list; int size; int maxSize;};void againMalloc(struct List *L){ /* 空间扩展为原来的2倍,并由p指针所指向,原内容被自动拷贝到p所指向的存储空间 */ elemType *p = realloc(L-list, 2 * L-maxSize * sizeof(elemType)); if(!p){ /* 分配失败则退出运行 */ printf(存储空间分配失败! ); exit(1); }
原创力文档

文档评论(0)