Algorithms_in_C++ 1.0.0
Set of 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.
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. |
std::vector< std::uint64_t > others::recursive_tree_traversals::BT::inorder | ( | Node * | root | ) |
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 |
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 |