This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues/pull-requests.
ecg-prog-filtered/u01/main.cpp

25 lines
500 B
C++

// SPDX-License-Identifier: GPL-3.0-or-later
#include <iostream>
#include "node.h"
int main() {
node *t = create_complete_tree(2, 4);
std::cout << *t;
delete t;
t = nullptr;
node *n = new node("foo");
n->add_child(new node("bar"));
n->get_child(0)->add_child(n);
std::cout << n->print_recursive();
delete n;
n = nullptr;
node *root = new node("root");
root->add_child(new node("left child"));
root->add_child(new node("right child"));
delete root;
root = nullptr;
}