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

25 lines
521 B
C++
Raw Normal View History

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"
int main(int argc, char **argv) {
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;
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;
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;
root = nullptr;
2023-04-21 22:46:18 +02:00
}