Tree is a recursive structure using nodes.
More...
#include <treestring.hpp>
Tree is a recursive structure using nodes.
A root value and subtrees of children, represented as a set of linked nodes.
TreeString::TreeString |
( |
| ) |
|
First node of the tree Default constructor
TreeString::TreeString |
( |
const TreeString & |
other | ) |
|
TreeString::~TreeString |
( |
| ) |
|
Destructor, destroy the whole tree
void TreeString::getWords |
( |
forward_list< string > & |
list | ) |
|
Put each word in a list The list must be initialized !
- Parameters
-
[in] | list | List containing string for each word stored in Tree |
void TreeString::getWordsFrequencies |
( |
forward_list< pair< string, int >> & |
words | ) |
|
Get a list of all words stored in Tree and their frequencies, i.e. how times a word was added
- Parameters
-
int] | list List of pair containing for each word in Tree his frequency |
int TreeString::height |
( |
| ) |
|
The height of the tree
- Parameters
-
[out] | hgt | Height of the tree |
void TreeString::put |
( |
const string & |
word | ) |
|
Put a word in the tree
- Parameters
-
[in] | word | New element to put into the tree |
string TreeString::toString |
( |
| ) |
|
Get a string representation of the Tree
- Parameters
-
[out] | desc | A string reprensation of the Tree where each Node tag is separated by a comma |
The documentation for this class was generated from the following file: