![]() |
AlgoPlus v0.1.0
|
tree class More...
#include <tree.h>
Classes | |
class | Iterator |
Public Member Functions | |
tree (std::vector< std::pair< std::string, T > > v={}) noexcept | |
constructor for tree class | |
void | insert (std::string direction, T info) |
insert function | |
bool | search (T key) |
search function | |
Iterator | begin () |
Iterator | end () |
std::vector< T > | inorder () |
inorder traversal | |
std::vector< T > | postorder () |
postorder function | |
std::vector< T > | preorder () |
preorder function | |
std::vector< std::vector< T > > | level_order () |
level order function | |
Friends | |
std::ostream & | operator<< (std::ostream &out, tree< T > &t) |
operator << for bst class | |
tree class
|
inlineexplicitnoexcept |
constructor for tree class
v | the input vector of pairs(string and T) to avoid doing multiple insertions |
|
inline |
inorder traversal
|
inline |
insert function
direction | string, directions for the insertion of value info |
info | the value of the new node |
|
inline |
level order function
|
inline |
postorder function
|
inline |
preorder function
|
inline |
search function
key | the key to be searched |