![]() |
#2
hellovfp2011-09-21 11:53
|
创建一个顺序表,有a-z 26个小写字母。怎么填入数据?#define LIST_INIT_SIZE 26
#define LISTINCREMENT 1 //这里不知道对吗?
typedef struct{
ElemType *elem;//这里用c++进行调试的时候,总是说ElemType没有定义,还有*elem前面没有加‘;’符号,很奇怪
int lengtg;
int listsize;
}SqList;
Status InitList_Sq(SqList &L)
L.elem=(ElemType*)malloc(LIST_INIT_SIZE*sizeof(ElemType));//分配空间
if(!L.elem) exit(OVERFLOW);
L.length=0;
L.listsize=LIST_INIT_SIZE;
return OK;
}//InitList_Sq
然后用自创ListInsert_Sq(SqList &L,int i,ElemType)在任意位置插入一个字母
求高手请教