集合接口:
//集合接口
interface ISet<E>
{
int Count {
get; }
bool IsEmpty {
get; }
void Add(E e);
void Remove(E e);
//查询集合是否包含某元素
bool Contains(E e);
}
实现链表的集合:
class LinkedList1Set<E> : ISet<E>
{
private LinkedList1<E> list;
public LinkedList1Set()
{
list = new LinkedList1<E>();
}
public int Count {
get {
return list.Count; } }
public bool IsEmpty {
get {
return