forked from NSUCodeSmugglers/QuickLexicon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTree.h
More file actions
27 lines (24 loc) · 652 Bytes
/
Tree.h
File metadata and controls
27 lines (24 loc) · 652 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
#ifndef TREE_H_INCLUDED
#define TREE_H_INCLUDED
#include "TreeNode.h"
#include "SortedList.h"
class Tree{
public:
TreeNode *root = new TreeNode;
Tree();
~Tree();
bool Search(string,string&,string&);
void DeleteWord(string);
void InsertWord(string,string);
void GetSuggestions(string, SortedList<string>&);
void PrintAll();
void PrintAllWords();
private:
void AddWord(string,string);
TreeNode Traverse(TreeNode*, SortedList<string>&);
TreeNode TraverseAll(TreeNode*);
TreeNode TraverseWords(TreeNode*);
TreeNode TraverseToDelete(TreeNode*);
void Fetch(string);
};
#endif // TREE_H_INCLUDED