⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set.h

📁 该压缩文件夹内有诸多常用算法和数据结构的c++模板编程实现
💻 H
字号:
#ifndef SET_H
#define SET_H
#include "LinkedList.h"
template<class T>
class Set
{
public:
	bool put(T e)
	{
		if (list.find(e)==-1)
		{
			list.add(e);
			return true;
		}
		return false;
	}
	T get(int index)
	{
		list.get(index);
	}
	int size()
	{
		return list.size();
	}
	bool remove(int index)
	{
		return list.remove(index);
	}
	void clear()
	{
		list.clear();
	}
protected:
	LinkedList<T> list;
private:
};
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -