//ArrayList.h文件
const int MaxSize = 50;
template<class T> //定义模板类ArrayList
class ArrayList{
public:
ArrayList() {
length = 0 }; //无参构造函数
ArrayList(T a[], int n); //有参构造函数
~ArrayList() {
};
void PrintList();
bool InsertList(int i, T a);
bool DeleteList(int i, T *a);
int Length();
int GetList(T x);
T GetNum(int i);
private:
int length; //线性表的长度
T data[MaxSize]; //存放线性表的数组
};
//ArrayList.cpp文件
#include"ArrayList.h"
template<class T>
ArrayList<T>::ArrayList(T a[], int n)
{
if