Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The function of this program is to perform some operations on the sequence table whose element type is integer. The program includes a header file to store the defined sequential table structure.
The function of this program is to perform some operations on the sequence table whose element type is integer. The program includes a header file to store the defined sequential table structure.
The function of this program is to perform some operations on the sequence table whose element type is integer. The program includes a header file, which is used to store the defined sequence table structure types and function declarations for various operations on the sequence table; The second is the realization file of sequence table operation, which is used to store the specific function definition and main functions of each sequence table operation.

Header file 1(seqlist 1.h)

/* Define ElemType as int type */

typedef int ElemType

# Define LIST_SIZE 100

Total allocation of storage space for sequential tables

/* Sequential storage type */

Typedef structure {

ElemType * elem

Int length;

int listsize} SqList

Header file 2

/* Define ElemType as int type */

typedef int ElemType

# Define LIST_SIZE 100

Total allocation of storage space for sequential tables

/* Sequential storage type */

Typedef structure {

elem type elem[LIST _ SIZE];

Int length;

int listsize} SqList

/* Initialize sequence table */

void InitList(SqList *l)

/* Clear the sequence table */

void ClearList(SqList *l)

/* Find the length of the sequence table */

int list length(SQL list * l)

/* Check whether the sequence table is empty */

int list empty(SQL list * l)

/* Check whether the sequence table is full */

int list full(SQL list * l)

/* Traversal order table */

void ListTraverse(SqList *l)

/* Find elements from the sequence table */

ElemType GetElem(SqList *l,int i,ElemType e)

/* Find the position of an element with the same value as the given element in the sequence table */

int LocateElem(SqList *l,ElemType e)

/* Insert elements into the sequence table */

void ListInsert(SqList *l,int i,ElemType e)

/* Delete elements from the sequence table */

ElemType ListDelete(SqList *l,int i,ElemType e)