|
| AbstractSyntaxTree (typename BinaryTree< std::string >::Node *node) |
| Constructor that takes in a root node representing the pre-constructed AST. More...
|
|
double | eval () const |
| Calculates the value from an AST (Abstract Syntax Tree). More...
|
|
| BinaryTree () |
| Constructor to create an empty tree. More...
|
|
| BinaryTree (Node *heapNode) |
| Constructor to that wraps raw nodes as a BinaryTree class. More...
|
|
| BinaryTree (const BinaryTree &other) |
| Copy constructor. More...
|
|
virtual | ~BinaryTree () |
| Destructor; frees all nodes associated by this tree. More...
|
|
const BinaryTree & | operator= (const BinaryTree &rhs) |
| Assignment operator. More...
|
|
void | clear () |
| Frees all nodes associated with this tree and sets it to be empty. More...
|
|
void | insert (const std::string &elem) |
| Inserts into the BinaryTree in BST order. More...
|
|
void | insertRandom (const std::string &elem, std::mt19937 &rng) |
| Inserts the given value into the BinaryTree, taking a random path to the leaf where it is inserted. More...
|
|
void | print () const |
| Prints the contents of the tree to stdout. More...
|
|
Node * | getRoot () const |
|
int | height () const |
| This lab deals with the following six helper functions: More...
|
|
void | printLeftToRight () const |
| Prints out the values of the nodes of a binary tree in order. More...
|
|
void | mirror () |
| Flips the tree over a vertical axis, modifying the tree itself (not creating a flipped copy). More...
|
|
bool | isOrderedIterative () const |
| isOrdered() function iterative version More...
|
|
bool | isOrderedRecursive () const |
| isOrdered() function recursive version More...
|
|
void | getPaths (std::vector< std::vector< std::string >> &paths) const |
| creates vectors of all the possible paths from the root of the tree to any leaf node and adds it to another vector. More...
|
|
int | sumDistances () const |
| Each node in a tree has a distance from the root node - the depth of that node, or the number of edges along the path from that node to the root. More...
|
|
void | inOrder (std::vector< std::string > &treeVector) |
| Uses vector to store values of the nodes of a binary tree in order. More...
|
|