有限資料元素序列。儲存方式分順序儲存與鏈式儲存。
namespace Xianfen.Net.DataStructure {
interface ILinearList<T> : IEnumerable<T> {
void Add(T t);
void AddHead(T t);
void AddTail(T t);
void Clear();
int Count { get; }
int Find(T t);
T GetAt(int pos);
T GetHead();
T GetTail();
void InsertAt(T t, int pos);
bool IsEmpty { get; }
void RemoveAll();
void RemoveAt(int pos);
void RemoveHead();
void RemoveTail();
void SetAt(int pos, T t);
}
}
後續分別以順序表、單向鏈結串列、雙向鏈結串列、循環鏈結串列實作此介面。