void Sqlist::Insert(int i, ElemType e) //插入
{
if (length == MAXSIZE)
cout << "FLOW!" << endl;
else
if (ilength + 1)
cout << "Insert ERROR!" << endl;
else
for (int j = length; j >= i; j--)
elem[j] = elem[j - 1];
elem[i - 1] = e;
length++;
cout << "Insert success!" << endl;
}
ElemType Sqlist::Delet(int i)//删除
{
ElemType x;
if (ilength)
cout << "RANGE ERROR!" << endl;
else
{
x = elem[i - 1];
for (int j = i; j < length; j++)
elem[j - 1] = elem[j];
length--;
cout << "success" << endl;
}
return x;
}