Glossygloss  0.2
Glossygloss is set of classes to use several data structure as Tree or hash table.
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Private Attributes | List of all members
TreeString Class Reference

Tree is a recursive structure using nodes. More...

#include <treestring.hpp>

Public Member Functions

 TreeString ()
 
 TreeString (const TreeString &other)
 
 ~TreeString ()
 
int height ()
 
void put (const string &word)
 
string toString ()
 
void getWords (forward_list< string > &list)
 
void getWordsFrequencies (forward_list< pair< string, int >> &words)
 

Private Attributes

Node _root
 

Detailed Description

Tree is a recursive structure using nodes.

A root value and subtrees of children, represented as a set of linked nodes.

Constructor & Destructor Documentation

TreeString::TreeString ( )

First node of the tree Default constructor

TreeString::TreeString ( const TreeString other)

Copy constructor

TreeString::~TreeString ( )

Destructor, destroy the whole tree

Member Function Documentation

void TreeString::getWords ( forward_list< string > &  list)

Put each word in a list The list must be initialized !

Parameters
[in]listList 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]hgtHeight of the tree
void TreeString::put ( const string &  word)

Put a word in the tree

Parameters
[in]wordNew element to put into the tree
string TreeString::toString ( )

Get a string representation of the Tree

Parameters
[out]descA string reprensation of the Tree where each Node tag is separated by a comma

Member Data Documentation

Node TreeString::_root
private

The documentation for this class was generated from the following file: