#include<iostream>
using namespace std;
//双指针法
#define InitSize 10
typedef int ElemType;
typedef struct
{
ElemType* data;
ElemType length;
ElemType MaxSize;
}SqList;
bool InitList(SqList& L)
{
L.data = new ElemType[InitSize];
if (L.data == NULL)
return false;
L.length = 0;
L.MaxSize = InitSize;
return true;
}
bool Input(SqList& L,int n)
{
if (n<1 || n>InitSize)
return false;
cout << "请输入" << n << "个数据" << endl;
for (int i = 0; i < n; i++)
{
cin>> L.data[i];
}
L.length = n;
return true;
}
void Show(SqList& L)
{
cout << "线性表数据为" << endl;
for (int i = 0; i < L.length; i++)
{
cout << L.data[i] << " ";
}
cout << endl;
}
void IncreaList(SqList& L, ElemType len)
{
ElemType* p = L.data;
L.data = new ElemType[InitSize + len];
for (int i =
11-14
3154