|
std::ostream & | operator<< (std::ostream &out, tree< T > &t) |
| operator << for bst class
|
|
◆ Iterator()
template<typename T>
tree< T >::Iterator::Iterator |
( |
const int64_t & | index, |
|
|
std::vector< T > & | els ) |
|
inlineexplicitnoexcept |
Construct a new Iterator object.
- Parameters
-
els | vector<T> - the elements in inorder fashion |
◆ inorder()
std::vector< T > tree< T >::inorder |
( |
| ) |
|
|
inline |
inorder traversal
- Returns
- vector<T>: the inorder traversal of the tree
◆ insert()
void tree< T >::insert |
( |
std::string | direction, |
|
|
T | info ) |
|
inline |
insert function
- Parameters
-
direction | string, directions for the insertion of value info |
info | the value of the new node |
◆ level_order()
std::vector< std::vector< T > > tree< T >::level_order |
( |
| ) |
|
|
inline |
level order function
- Returns
- vector<vector<T>>: the level order traversal of the tree
◆ operator!=()
operator != for type Iterator
- Parameters
-
- Returns
- true if index == it.index
-
false otherwise
◆ operator*()
template<typename T>
T tree< T >::Iterator::operator* |
( |
| ) |
|
|
inline |
operator * for type Iterator
- Returns
- T the value of the node
◆ operator++() [1/2]
◆ operator++() [2/2]
◆ operator--() [1/2]
◆ operator--() [2/2]
◆ operator=()
◆ postorder()
std::vector< T > tree< T >::postorder |
( |
| ) |
|
|
inline |
postorder function
- Returns
- vector<T>: the postorder traversal of the tree
◆ preorder()
std::vector< T > tree< T >::preorder |
( |
| ) |
|
|
inline |
preorder function
- Returns
- vector<T>: the preorder traversal of the tree
◆ search()
bool tree< T >::search |
( |
T | key | ) |
|
|
inline |
search function
- Parameters
-
key | the key to be searched |
- Returns
- true: if the key exist in the tree
-
false: otherwise
◆ tree()
tree< T >::tree |
( |
std::vector< std::pair< std::string, T > > | v = {} | ) |
|
|
inlineexplicitnoexcept |
constructor for tree class
- Parameters
-
v | the input vector of pairs(string and T) to avoid doing multiple insertions |
The documentation for this class was generated from the following file:
- /Users/runner/work/AlgoPlus/AlgoPlus/src/classes/tree/tree.h