-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLLDataNode.h
More file actions
35 lines (25 loc) · 779 Bytes
/
LLDataNode.h
File metadata and controls
35 lines (25 loc) · 779 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
// LLDataNode.h
#include <vector>
#include "DataNode.h"
#ifndef LLDATANODE_H
#define LLDATANODE_H
// a struct to simplify keeping track of all the similar words found in the process of searching
struct resultingNodes {
std::vector<std::string> similarWords;
std::string word;
bool wordExists;
};
class LLDataNode {
protected:
std::shared_ptr<DataNode> head;
public:
LLDataNode();
void insert(std::shared_ptr<DataNode> node);
bool isEmpty();
resultingNodes search(std::shared_ptr<DataNode> word);
void print();
// access methods
std::shared_ptr<DataNode> getHead();
void setHead(std::shared_ptr<DataNode> node);
}; // end class declaration
#endif /* LLDATANODE_H */