数据结构教程课答案
数据结构教程课后答案
/*文件名:algo2-1.cpp*/
#include stdio.h
#include malloc.h
#define MaxSize 50
typedef char ElemType;
typedef struct
{
ElemType elem[MaxSize];
int length;
} SqList;
void InitList(SqList *L)
{
L=(SqList *)malloc(sizeof(SqList));
L-length=0;
}
void DestroyList(SqList *L)
{
free(L);
}
int ListEmpty(SqList *L)
{
return(L-length==0);
}
int ListLength(SqList *L)
{
return(L-length);
}
void DispList(SqList *L)
{
int i;
if (ListEmpty(L)) return;
for (i=0;iL-length;i++)
printf(%c,L-elem[i]);
printf(\n);
}
int GetElem(SqList *L,int i,ElemType e)
您可能关注的文档
最近下载
- 《工程哲学教学课件》15poe8.ppt VIP
- 最新中考英语阅读理解50篇精品资料.doc VIP
- 2025年清远市直机关遴选公务员考试真题汇编含答案解析(夺冠).docx VIP
- 2025年内蒙古自治区中考英语真题卷(含答案与解析).pdf VIP
- 《工程哲学教学课件》15poe9.ppt VIP
- 2026年四川省绵阳市盐亭县九年级中考二模英语试题(试卷+解析).pdf VIP
- 《工程哲学教学课件》15poe7.ppt VIP
- 机械故障诊断技术 教学课件 作者 张键 机械故障诊断技术6_旋转机械故障诊断.ppt VIP
- 2020-2021学年深圳实验学校自主招生物理(模拟卷)+答案.pdf VIP
- 《工程哲学教学课件》15poe5.ppt VIP
原创力文档

文档评论(0)