-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictionaryHashtable.cpp
More file actions
42 lines (35 loc) · 993 Bytes
/
Copy pathDictionaryHashtable.cpp
File metadata and controls
42 lines (35 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Name: Rui Deng
* Dadong Jing
* Data: Feb 12, 2016
* Overview: this file is to implement the functionality of DictionaryHashtable
* Assignment number: PA3
*/
#include "util.hpp"
#include "DictionaryHashtable.hpp"
/**
* Name: Rui Deng
* Dadong Jing
* Data: Feb 12, 2016
* Overview: this file is to implement the functionality of DictionaryHashtable
* Assignment number: PA3
*/
#include "util.hpp"
#include "DictionaryHashtable.hpp"
/* Create a new Dictionary that uses a Hashset back end */
DictionaryHashtable::DictionaryHashtable(){}
/* Insert a word into the dictionary. */
bool DictionaryHashtable::insert(std::string word)
{
return (myDictionary.insert(word).second);
}
/* Return true if word is in the dictionary, and false otherwise */
bool DictionaryHashtable::find(std::string word) const
{
return (myDictionary.find(word) != myDictionary.end());
}
/* Destructor */
DictionaryHashtable::~DictionaryHashtable()
{
myDictionary.clear();
}