#include<iostream.h>
#define LINK_INIT_SIZE 100
#define LINK_INCREAMENT 10
#define ElemType int
#define Status int
#define OK 0;
#define ERROR -1;
typedef struct
{
ElemType *elem;
int len;
int listsize;
}SqList;
//the following is the basic operation of the list
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Function:init the sqlist *
* parameter:SqList:the quote of the struct SqList *
* return: OK:success, ERROR:fail *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
Status InitList_Sq(SqList &L)
{
return OK;
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Function:Destroy the sqlist *
* parameter:SqList:the quote of the struct SqList *
* return: OK:success, ERROR:fail *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
Status DestroyList_Sq(SqList &L)
{
return OK;
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Function:Clear the sqlist *
* parameter:SqList:the quote of the struct SqList *
* return: OK:success, ERROR:fail *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
Status ClearList(SqList &L)
{
return OK;
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Function:to check whether the SqList is empty *
* parameter:SqList:the struct SqList *
* return: OK:success, ERROR:fail *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
Status ListEmpty(SqList L)
{
return OK;
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Function:to caluate the lenth of the SqList *
* parameter:SqList:the struct SqList *
* return: lenth:the length of the SqList, ERROR:Exception *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
Status ListLenth(SqList L)
{
int len=0;
return len;
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Function:to caluate the lenth of the SqList *
* parameter:SqList:the struct SqList *
* return: lenth:the length of the SqList, ERROR:Exception *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
Status GetElem(SqList L, int i, ElemType &e)
{
return OK;
}
Status LocateElem(SqList &L, int i, ElemType e)
{
return OK;
}
Status PriorElem(SqList L, ElemType cur_e, ElemType &pri_e)
{
return OK;
}
Status NextElem(SqList L, ElemType cur_e, ElemType &next_e)
{
return OK;
}
Status ListInsert(SqList &L, int i, ElemType &e)
{
return OK;
}
Status ListDelete(SqList &L, int i, ElemType &e)
{
return OK;
}
Status ListUnion(SqList &La, SqList &Lb)
{
return OK;
}
Status MergeList(SqList La, SqList Lb, SqList &Lc)
{
return OK;
}