#include #include #include "tree.h" int main(void) { Tree tree = {NULL}; // Some test insertions tree_insert(&tree, 1); tree_insert(&tree, 2); tree_insert(&tree, 3); // Check size and print inorder printf("Tree size: %d\n", tree_size(tree.root)); tree_inorder(tree.root); printf("Tree contains 2: %d\n", tree_contains(tree.root, 2)); // Clear the tree tree_clear(&tree); // Check if the tree is really empty if (tree.root == NULL) printf("Tree is empty\n"); else printf("Tree is not empty: %d\n", tree.root->data); // Check size and print inorder printf("Tree size: %d\n", tree_size(tree.root)); tree_inorder(tree.root); return 0; }