//順序表的建立、查找、插入與刪除
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#define ListSize 100 //表最大長度
//結構定義
typedef struct SeqList
{
int node[ListSize] //存放表結點
int length //當前表長度
} SeqList
//插入元素
insertList(SeqList *list, int e)
{
int i=list->length-1 //先將i指定為最后一項
if(i>=ListSize-1) //表已經達到最大長度ListSize
{
printf("表已滿,不能增加新的項!\n")
標簽:
include
gt
lt
malloc
上傳時間:
2014-01-17
上傳用戶:dongqiangqiang