storedset.h

来自「本程序用VC++完成 定义类模板SortedSet (包括方法的实现)」· C头文件 代码 · 共 32 行

H
32
字号
// StoredSet.h: interface for the StoredSet class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_STOREDSET_H__608D735D_6375_41D0_B714_EBB11564B836__INCLUDED_)
#define AFX_STOREDSET_H__608D735D_6375_41D0_B714_EBB11564B836__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
const int DefaultNum = 10;

template<class Type>
class StoredSet  
{
private:
	Type *mpElem;
	int mnSize;
	int mnCount;
	int (*mpComp)(const Type& t1,const Type& t2);
public:
	StoredSet();
	StoredSet(int(*pCompare)(const Type& t1,const Type& t2) , int nDefaultSize = DefaultNum);
	int Insert(const Type& t1);
	int Get(const Type& t1);
	int Del(const Type& t1);
	virtual ~StoredSet();
	int GetCount();
};

#endif // !defined(AFX_STOREDSET_H__608D735D_6375_41D0_B714_EBB11564B836__INCLUDED_)

⌨️ 快捷键说明

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