1、Definiation
A list is a sequence. a0, a1,a2,..., aN (N>0)
2、Character
For any list except the empty list, we say that Ai follows(or succeeds)Ai-1(i<N) and that Ai-1 precedes Ai(i>0).
3、Operations
(1) LenList(L); // 返回表的长度(2) GetElem(i, e); // 换值(3) SearchElem(e, i); // 按值查找(4) InertElem(i, e); // 插值(5) DeleteElem(i); // 删值
(1)LenList(L);
LenList(L) output: 整数类型; Post-condition: 输出表的长度;
(2) GetElem(L, i);
GetElem(i, e) Input: 位置参数; output: e; Pre-condition: 0<=i
(3) SearchElem(L, e)
SearchElem(e, i) intput: e; output: 位置参数i; Pre-condition: i
(4)InsertElem(i, e)
InsertElem(i, e) input: 位置i, e; Pre-condition: 0<=i
(5)DeleteElem(i)
DeleteElem(i) input: 位置参数i; Pre-condition: 0<=i