using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ListMethod { //一旦定义了接口,实现接口的派生类中必须实现接口中定义的所有成员,一个都不能少。 public interface IListDS<T> { int GetLength(); void Clear(); bool IsEmpty(); void Append(T item); void Insert(T item, int i); T Delete(int i); T GetElem(int i); int Locate(T value); } public class seqList<T>:IListDS<T> { private int maxsize;//顺序表的容量 private T[] data;//数组,用于存储顺序表中的数据元素 private int last;//如果顺序表中有数据元素时,last的变化范围是0到maxsize-1,如果顺序表为空,last=-1 //定义一个索引器 public T this[int index] { get { return data[index]; } set { data[index] = value; } } //容量属性 public int Maxsize { get { return maxsize; } set { maxsize = value; } } //最后一个数据元素位置属性 public int Last { get { return last; } set { last = value; } } //顺序表长度属性 public int Length { get { retur