This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues/pull-requests.
2023-04-22 14:45:43 +02:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2023-04-22 11:43:39 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
2023-04-21 22:46:18 +02:00
|
|
|
#include "node.h"
|
|
|
|
|
2023-05-20 11:29:04 +02:00
|
|
|
int main() {
|
2023-04-21 23:56:14 +02:00
|
|
|
node *t = create_complete_tree(2, 4);
|
2023-04-22 11:43:39 +02:00
|
|
|
std::cout << *t;
|
2023-04-21 23:56:14 +02:00
|
|
|
delete t;
|
2023-04-22 11:43:04 +02:00
|
|
|
t = nullptr;
|
2023-04-22 12:53:34 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2023-04-21 22:46:18 +02:00
|
|
|
node *root = new node("root");
|
|
|
|
root->add_child(new node("left child"));
|
|
|
|
root->add_child(new node("right child"));
|
|
|
|
delete root;
|
2023-04-22 11:43:04 +02:00
|
|
|
root = nullptr;
|
2023-04-21 22:46:18 +02:00
|
|
|
}
|