#include <stdio.h>
#include <stdlib.h>
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
typedef int ElemType;
typedef struct{
ElemType *elem;
int length;
int listsize;
}SqList;
int InitList_Sq(SqList *L);
int DestroyList(SqList *L);
void Sq_Tranverse(SqList L);
void MergeList_Sq(SqList La,SqList Lb,SqList *pLc);
int SqListEmtype(SqList *L);
int InitList_Sq(SqList *L){
(* L).elem=(ElemType *)malloc(LIST_INIT_SIZE*sizeof(ElemType));
if(!(*L).elem) exit(-1);
(*L).length=0;
(*L).listsize=LIST_INIT_SIZE;
return 0;
}
int SqListEmtype(SqList *L)
{
if((*L).length==0) return 1;
else return 0;
}
int DestroyList(SqList *L)
{
free( (*L).elem );
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载