电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

C++英文词典的简单实现

C++英文词典的简单实现_第1页
1/7
C++英文词典的简单实现_第2页
2/7
C++英文词典的简单实现_第3页
3/7
用 散 列 表 实 现 简 单 的 英 文 词 典 2011 年4 月4 日星期一 一 . 头 文 件 : //文件名:Word.h //单词类的定义 #include #include class Word{ friend ostream& operator<<(ostream &os, const Word & obj)//重载输出函数 { int n=strlen(obj.word); for(int i=0; i #include template class openHashTable{ private: struct node{//私有结点 Type data; struct node *next; node(){ next = NULL; } node(Type &d){ data = d; next = NULL;} }; node **array; int(*key)(const Type &x);//关键字 static int defaultKey(const int &k) { return k; }//缺省值 int size; public: openHashTable(int length =101 , int(* f)(const Type &x) = defaultKey); ~ openHashTable(); int find(Type &x); //查找函数 bool insert(Type &x); //插入函数 bool remove( Type &x); //删除函数 void output(); //输出词典函数 }; //======================开散列表函数的实现===================================== //构造函数的实现 template openHashTable::openHashTable(int length, int(*f)(const Type &x)) { size = length; array = new node *[size]; key = f; for(int i=0; i openHashTable::~ openHashTable() { node *p, *q; for(int i=0; inext; delete p; p = q; }while(p!=NULL); } delete [] array; } //插入函数的实现 template bool openHashTable::insert(Type...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

C++英文词典的简单实现

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部