-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAVLIndex.h
More file actions
38 lines (24 loc) · 792 Bytes
/
Copy pathAVLIndex.h
File metadata and controls
38 lines (24 loc) · 792 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
#ifndef AVL_Index_H
#define AVL_Index_H
#include "IndexInterface.h"
#include "AVL_Tree.cpp"
#include <string>
#include <vector>
class AVLIndex : public IndexInterface{
public:
virtual ~AVLIndex();
virtual int addDocument(string name, string author, string date);
virtual bool addWordForDocument(int documentIndex, string word);
virtual vector<string> getDocumentsForWord(string word);
//virtual bool sortComparator(int, int, vector<string>);
virtual bool writeToFile(string);
virtual bool readFromFile(string);
virtual int numWords();
virtual int numDocs();
virtual pair<string, string> getAuthorAndTimeForDocNamed(string name);
private:
vector<pair<string, int> > documentTitles;
map<string, pair<string, string> > authorsAndDates;
AVLTree<string> index;
};
#endif