TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
BT used to make the entire structure of the binary tree and the functions associated with the binary tree. More...
Public Member Functions | |
Node * | createNewNode (std::uint64_t) |
will allocate the memory for a node and, along the data and return the node. | |
std::vector< std::uint64_t > | inorder (Node *) |
std::vector< std::uint64_t > | preorder (Node *) |
preorder function that will perform the preorder traversal recursively, and return the resultant vector that contain the preorder traversal of a tree. | |
std::vector< std::uint64_t > | postorder (Node *) |
postorder function that will perform the postorder traversal recursively, and return the result vector that contain the postorder traversal of a tree. | |
Public Attributes | |
std::vector< std::uint64_t > | inorder_result |
std::vector< std::uint64_t > | preorder_result |
std::vector< std::uint64_t > | postorder_result |
BT used to make the entire structure of the binary tree and the functions associated with the binary tree.
Definition at line 88 of file recursive_tree_traversal.cpp.
Node * others::recursive_tree_traversals::BT::createNewNode | ( | std::uint64_t | data | ) |
will allocate the memory for a node and, along the data and return the node.
data | value that a particular node will contain. |
Definition at line 118 of file recursive_tree_traversal.cpp.
std::vector< std::uint64_t > others::recursive_tree_traversals::BT::inorder | ( | Node * | root | ) |
Definition at line 132 of file recursive_tree_traversal.cpp.
std::vector< std::uint64_t > others::recursive_tree_traversals::BT::postorder | ( | Node * | root | ) |
postorder function that will perform the postorder traversal recursively, and return the result vector that contain the postorder traversal of a tree.
root | head/root node of a tree |
Definition at line 172 of file recursive_tree_traversal.cpp.
std::vector< std::uint64_t > others::recursive_tree_traversals::BT::preorder | ( | Node * | root | ) |
preorder function that will perform the preorder traversal recursively, and return the resultant vector that contain the preorder traversal of a tree.
root | head/root node of a tree |
Definition at line 152 of file recursive_tree_traversal.cpp.
std::vector<std::uint64_t> others::recursive_tree_traversals::BT::inorder_result |
Definition at line 91 of file recursive_tree_traversal.cpp.
std::vector<std::uint64_t> others::recursive_tree_traversals::BT::postorder_result |
Definition at line 95 of file recursive_tree_traversal.cpp.
std::vector<std::uint64_t> others::recursive_tree_traversals::BT::preorder_result |
Definition at line 93 of file recursive_tree_traversal.cpp.