#include
#include
#define maxsize 100
typedef
int elemtype;
typedef
struct sqlist
sqlist;
void initlist(sqlist **l);
void destory(sqlist **l);
void createlist(sqlist *l,elemtype a,int i);
void displist(sqlist *l);
void deletelemtype(sqlist *l,elemtype e);
void destory(sqlist **l)
void initlist(sqlist **l)
}void createlist(sqlist *l,int a,int i)
void displist(sqlist *l)
void deletelemtype(sqlist *l,elemtype e)//刪除順序線性表上的所有e的元素。
l->length = j;
}int main(void)
; int i = sizeof(a)/sizeof(int);
elemtype e;
sqlist *l = null;
initlist(&l);
createlist(l,a,i);
printf("刪除前的元素\n");
displist(l);
printf("請輸入你想刪除的元素\n");
scanf("%d",&e);
printf("刪除後的元素\n");
deletelemtype(l,e);//刪除所有e的元素(在原始線性表上操作用i,j兩個下標操作);
displist(l);
destory(&l);
return
0;}
順序線性表
sequential linear list this file define the ds of sequential linear list s basic operation,it includes linear list insert,delete,initial,and sort oper...
順序線性表
include int const maxsize 100 typedef int element typedef struct list element list get index value list int int main 函式 初始化線性表 void list init list ls ...
順序線性表
define true 1 define false 0 define ok 1 define error 0 define infeasible 1 define overflow 2 define list init size 100 define list increment 10 typed...