diff --git a/exercise1/node.h b/exercise1/node.h index 89175ba..42b5b0d 100644 --- a/exercise1/node.h +++ b/exercise1/node.h @@ -12,7 +12,8 @@ class Node { public: - Node(const std::string &name = ""); + Node(const std::string &name); + Node(); virtual ~Node(); std::string get_name() const; @@ -22,7 +23,8 @@ class Node Node *get_child(int i) const; void add_child(Node *child); - void print(std::ostream &str = std::cout, uint32_t depth = 0) const; + void print(std::ostream& stream) const; + void print(std::ostream& stream, int level, std::set& set) const; static Node *create_complete_tree(uint32_t nr_child_nodes, uint32_t tree_depth); static void traverse_tree(const Node *node, std::function predicate, bool recursive, uint32_t depth = 0); @@ -36,6 +38,8 @@ class Node static void traverse_tree_iterative(const Node *node, std::function predicate, uint32_t depth = 0); }; +std::string repeat(std::string value, int times); + extern std::ostream &operator<<(std::ostream &os, const Node *node); -#endif // NODE_H \ No newline at end of file +#endif // NODE_H