-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatastructures.h
More file actions
33 lines (31 loc) · 849 Bytes
/
datastructures.h
File metadata and controls
33 lines (31 loc) · 849 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
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/string.hpp>
using namespace std;
class DataStructures {
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & myMap;
ar & wordPos;
}
string word; //-Word input
string def; //-Word def input
int index; //-Sequence
public:
DataStructures();
map<string, string> myMap;
map<string, int> wordPos;
void add(const string word, const string def, const string in);
void rm(const int index);
void display();
void update(const string word, const string def, const string in);
string recent() const;
string search(const string word) const;
};