1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.0 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef LINEARLIST_H
#define LINEARLIST_H
template <class T>
class LinearList{
public:
LinearList(){}; //构造函数
~LinearList(){}; //析构函数
virtual int Size()const = 0; //求表最大体积
virtual int Length()const = 0; //求表长度
virtual int Search(T& x)const = 0; //在表中搜索给定值x
virtual int Locate(int i)const = 0; //在表中定位第i个算数的位置
virtual bool getData(int i,T& x)const = 0; //取第i个表项的值 virtual T * getData(int i)const = 0;
virtual void setData(int i,T& x) = 0; //修改第i个表项的值为x
virtual bool Insert(int i,T& x) = 0; //在第i个表项后插入x
virtual bool Remove(int i,T& x) = 0; //删除第i个表项通过x返回
virtual bool IsEmpty()const = 0; //判表空
virtual bool IsFull()const = 0; //判表满
virtual void Sort() = 0; //排序
virtual void input() = 0; //输入
virtual void output() = 0; //输出
//virtual LinearList<T>* operator =(LinearList<T>& L) = 0; //复制
}
#endif /* LINEARLIST_H_ */