diff --git a/u01/node.cpp b/u01/node.cpp index 3f0e0c0..ece43ab 100644 --- a/u01/node.cpp +++ b/u01/node.cpp @@ -65,7 +65,7 @@ std::string node::print_recursive(unsigned int depth, std::string node::print_iterative() const { std::stringstream output; std::stack> stack; - stack.push(std::make_pair(this, 0)); + stack.push({this, 0}); std::set visited = {}; while (!stack.empty()) { @@ -81,7 +81,7 @@ std::string node::print_iterative() const { // to achieve the same output as the recursive approach. // Otherwise, the order of the children is reversed (due to LIFO). for (std::size_t i = n->get_nr_children(); i > 0; i--) { - stack.push(std::make_pair(n->get_child(i - 1), depth + 1)); + stack.push({n->get_child(i - 1), depth + 1}); } } else { output << " [↝ " << n->get_name() << "]";