数据结构实验试卷.docVIP

  • 12
  • 0
  • 约7.66千字
  • 约 12页
  • 2016-10-15 发布于湖北
  • 举报
#define MaxSize 10 #includestdio.h #include malloc.h typedef char ElemType; typedef struct { ElemType data[MaxSize]; int length; }SqList; void InitList(SqList * L) { L=(SqList * )malloc(sizeof(SqList)); L-length=0; } bool ListInsert(SqList * L,int i,ElemType e) { int j; if(i1||iL-length+1) return false; i--; for(j=L-length;ji;j--) L-data[i]=L-data[j-1]; L-data[i]=e; L-length++; return true; } void DispList(SqList * L) { int i; for(i=0;iL-length;i++) printf(%c,L-data[i]); printf(\n); } int ListLength(SqList * L) { return(L-length); } bool ListEmpty(SqList * L) {

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档