dictionary.h
来自「用VC实现散列表」· C头文件 代码 · 共 25 行
H
25 行
//The Dictionary abstract class.KEComp compares a key
//and an element.EEComp compares two elements.
template<class Key,class Elem,class Comp>
class Dictionary{
public:
//Reinitialize dictionary
virtual void clear()=0;
//Insert an element.return true if insert is
//successful,false otherwise
virtual bool insert(const Elem&)=0;
//Remove some element matching Key,Return true if such
//exits,flase otherwise,if multiple entries match
//Key,an arbitrary one is removed.
//Remove and return an arbitrary element from dictionary
//Return true if some element is found,false otherwise.
virtual bool removeAny(Elem&)=0;
//Return a copy of some element matching Key,Return true
//if such exists,false otherwise.if multiple elements
// match Key,return an arbitrary one.
virtual bool find(const Key&,Elem&) const=0;
virtual void print() const=0;
//Return the number of elements in the dictionary.
virtual int size()=0;
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?