void bst_add(bst* tree, void* element) { assert(tree); assert(element); // Creating the new node bst_node* node = bst_create_node(tree->data_size, element); if(tree->root) bst_add_rec(tree->compare, tree->root, node); // Start recursion else { tree->root = node; // Setting the new node as the tree's root } }
void bst_insert(bst_t *bst, int key) { bst_node_t *n = bst_create_node(key); bst_insert_node(bst, n); }