Lab8/avl_bag_2.c
/******************************************************************************
 *  Definitions of "public" functions -- see header file for documentation.   *
 ******************************************************************************/
Definitions of "public" functions -- see header file for documentation.
Definitions of " public " functions -- see header file for documentation .
bag_t *bag_create(int (*cmp)(bag_elem_t, bag_elem_t))
{
    bag_t *bag = malloc(sizeof(bag_t));
    if (bag) {
        bag->size = 0;
        bag->root = NULL;
        bag->cmp = cmp;
    }
    return bag;
}
bag_t * bag_create ( int ( * cmp ) ( bag_elem_t , bag_elem_t ) ) { bag_t * bag = malloc ( sizeof ( bag_t ) ) ; if ( bag ) { bag -> size = 0 ; bag -> root = NULL ; bag -> cmp = cmp ; } return bag ; }
Definitions of "public" functions -- see header file for documentation.
Definitions of " public " functions -- see header file for documentation .