8576 顺序线性表的基本操作 时间限制:1000MS 内存限制:1000K 提交次数:9027 通过次数:2456 题型: 编程题 语言: 无限制 Description
编写算法,创建初始化容量为LIST_INIT_SIZE的顺序表T,并实现插入、删除、遍历操作。本题目给出部分代码,请补全内容。 #include<> #include<> #define OK 1 #define ERROR 0 #define LIST_INIT_SIZE 100 #define LISTINCREMENT 10 #define ElemType int
typedef struct {
int *elem; int length; int listsize;
}SqList;
int InitList_Sq(SqList &L) { n\
} while(1) {
printf(\
scanf(\ switch(a) {
case 1: scanf(\
if(_________________________) printf(\
2:Delete element 3:Load all elements 0:Exit Please choose:
The Element 2 is Successfully Inserted! 1:Insert element 2:Delete element 3:Load all elements 0:Exit Please choose:
The Element 3 is Successfully Inserted! 1:Insert element 2:Delete element 3:Load all elements 0:Exit Please choose:
The Element 3 is Successfully Deleted! 1:Insert element 2:Delete element 3:Load all elements 0:Exit Please choose: The List is: 2
1:Insert element 2:Delete element 3:Load all elements 0:Exit Please choose: 作者 yqm
解法一:(正规解法) #include<> #include<> #define OK 1 #define ERROR 0 #define LIST_INIT_SIZE 100 #define LISTINCREMENT 10 #define ElemType int
typedef struct {
int *elem; int length; int listsize;
}SqList;
int InitList_Sq(SqList &L) { n\