text: #include <stdio.h>
  #include <assert.h>
  #include <stdlib.h>
  #include <time.h>
  #include "btree.h"
  
  int* create_int(int val)
  {
      int* p = malloc(sizeof(int));
      *p = val;
      return p;
  }
  
  
  int compare_ints(void* a, void* b)
  {
      return *(int*)a - *(int*)b;
  }
  
  void print_int(void* a)
  {
      printf("%d ", *(int*)a);
  }
  
  int main(void)
  {
      srand(time(NULL));
  
      BTree btree = btree_create(compare_ints, print_int, free);
  
      // btree_insert(btree, create_int(6));
      // btree_insert(btree, create_int(8));
      // btree_insert(btree, create_int(14));
      // btree_insert(btree, create_int(17)); 
      // btree_insert(btree, create_int(19));
      // btree_insert(btree, create_int(20));
      // btree_insert(btree, create_int(21));
      // btree_insert(btree, create_int(9));
      // btree_insert(btree, create_int(10));
      // btree_insert(btree, create_int(5));
      // btree_insert(btree, create_int(4));
  
      btree_fill_custom(btree);
      
      // int elements = 10000000;
      // int dups = 0;
      // int removals = 0;
  
      // for (int i = 0; i < elements; i++)
      // {
      //     int* val = create_int(rand());
      //     int v = *val;
      //     size_t size = btree_size(btree);
      //     btree_insert(btree, val);
  
      //     if (size == btree_size(btree))
      //         dups++;
  
      //     assert(btree_find_node(btree, &v));        
  
      //     if (rand() % 5 == 0)
      //     {
      //         removals++;
      //         assert(btree_remove(btree, &v));
      //     }
      // }
  
  
      // printf("Duplicates inserted: %d\nRemovals: %d\nCorrect sum: %d\nSize: %d\n\n", dups, removals, removals + dups +  btree_size(btree) == elements, btree_size(btree));
  
      btree_print_tree(btree);
  
      int a = 14;
      btree_remove(btree, &a);
  
      btree_print_tree(btree);
  
      a = 7;
      btree_remove(btree, &a);
  
      btree_print_tree(btree);
  
      a = 22;
      btree_remove(btree, &a);
  
      btree_print_tree(btree);
  
  
      btree_destroy(btree);
  
      return 0;
  }