C++单循环链表(迭代器版)
1 #ifndef _LIST_H_ 2 #define _LIST_H_ 3 //虚基类 4 template<class ElemType> 5 class List 6 { 7 public: 8 List() {}; 9 virtual ~List() {}; 10 virtual void Clear() = 0;//清空数据结构 11 virtual void Insert(const int& i, const ElemType& X) = 0;//插入元素 12 virtual void ReMove(const int &i) = 0;//移除指定位置的元素 13 virtual void Erase(const ElemType& X) = 0;//删除表中所有X元素 14 virtual int Search(const ElemType& X) const = 0;//搜索某个元素 15 virtual void Traverse() const = 0;//遍历数据结构 16 virtual ElemType Visit(const int& i)const = 0;//访问某个元素 17 }; 18 #endif // !_LIST_H_ List.h 1 #ifndef __SCYCLISTLIST_H__ 2 #define _