顺序表参考代码.docVIP

  • 23
  • 0
  • 约9.7万字
  • 约 9页
  • 2016-12-25 发布于河南
  • 举报
#includeiostream #includefstream using namespace std; const int LISTINITSIZE=100; const int LISTINCREMENT=10; struct student { char no[20]; char name[20]; int english; int math; }; typedef student elemtype; struct sqlist { elemtype *elem; int length; int listsize; int incrementsize; }; //初始化顺序表l void initlist(sqlist l,int maxsize=LISTINITSIZE,int incresize=LISTINCREMENT) { l.elem=new elemtype[maxsize]; l.length=0; l.listsize=maxsize; l.incrementsize=incresize; } //当线性表空间不足时,进行扩容操作 void increment(sqlist l) { elemtype *a=new elemtype[l.listsize+l.incrementsize]; for(int i=0;il.len

文档评论(0)

1亿VIP精品文档

相关文档