Skip to content
Snippets Groups Projects
bin_tree_main.c 538 B
#include "bin_tree.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

void main() {
    bool b     = false;
    arbre tree = NULL;
    arbre_print(tree, 1);
    do {
        printf("insert val = ");
        int val;
        scanf("%d", &val);
        b = arbre_insert(tree, val);
        arbre_print(tree, 1);
    } while (b);
    node *nd;
    do {
        printf("delete val = ");
        int val;
        scanf("%d", &val);
        b = arbre_delete(&tree, val);
        arbre_print(tree, 1);
    } while (NULL != tree);
}