25 lines
521 B
C++
25 lines
521 B
C++
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
#include <iostream>
|
|
|
|
#include "node.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
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;
|
|
}
|