35 std::unique_ptr<Node<T>>
left;
75 data{std::move(data)},
88 void printNode(std::ostream& os,
const bool& printChildren) {
89 os <<
"[" <<
this <<
"] ";
90 os <<
"Key: " << std::setw(4) << data.first
91 <<
", Value: " << std::setw(4) << data.second << std::endl;
95 <<
"[" << left.get() <<
"] " 96 <<
"Key: " << std::setw(4) << left .get()->data.first
97 <<
", Value: " << std::setw(4) << left .get()->data.second << std::endl;
101 <<
"[" << right.get() <<
"] " 102 <<
"Key: " << std::setw(4) << right.get()->data.first
103 <<
", Value: " << std::setw(4) << right.get()->data.second << std::endl;
void printNode()
Utility function that prints a Node.
Definition: Node.hpp:113
T data
Data stored in this Node.
Definition: Node.hpp:33
void printNode(std::ostream &os, const bool &printChildren)
Utility function that prints a Node.
Definition: Node.hpp:88
std::unique_ptr< Node< T > > right
Right child of this Node.
Definition: Node.hpp:37
std::unique_ptr< Node< T > > left
Left child of this Node.
Definition: Node.hpp:35
Node(const T &data, Node< T > *parent) noexcept
Copy constructor with data.
Definition: Node.hpp:60
Node< T > * parent
Parent of this Node.
Definition: Node.hpp:39
Node(T &&data, Node< T > *parent) noexcept
Move constructor with data.
Definition: Node.hpp:74
Class that implements a node of a tree.
Definition: Node.hpp:26
Namespace that stands for "Advanced Programming Utils".
Definition: Iterator.hpp:13
Node() noexcept
Void constructor.
Definition: Node.hpp:46