예제 #1
0
/**
 * Tests if the first set is less than the second set.
 */
bool_t set_less(const set_t* cpset_first, const set_t* cpset_second)
{
    assert(cpset_first != NULL);
    assert(cpset_second != NULL);

#ifdef CSTL_SET_AVL_TREE
    return _avl_tree_less(&cpset_first->_t_tree, &cpset_second->_t_tree);
#else
    return _rb_tree_less(&cpset_first->_t_tree, &cpset_second->_t_tree);
#endif
}
예제 #2
0
bool_t map_less(const map_t* cpt_mapfirst, const map_t* cpt_mapsecond)
{
    assert(cpt_mapfirst != NULL && cpt_mapsecond != NULL);
    assert(_same_map_pair_type(&cpt_mapfirst->_t_pair, &cpt_mapsecond->_t_pair));

#ifdef CSTL_MAP_AVL_TREE
    return _avl_tree_less(
        _GET_MAP_AVL_TREE(cpt_mapfirst), _GET_MAP_AVL_TREE(cpt_mapsecond));
#else
    return _rb_tree_less(
        _GET_MAP_RB_TREE(cpt_mapfirst), _GET_MAP_RB_TREE(cpt_mapsecond));
#endif
}
예제 #3
0
/**
 * Tests if the first map is less than the second map.
 */
bool_t map_less(const map_t* cpmap_first, const map_t* cpmap_second)
{
    assert(cpmap_first != NULL);
    assert(cpmap_second != NULL);
    assert(_pair_is_inited(&cpmap_first->_pair_temp));
    assert(_pair_is_inited(&cpmap_second->_pair_temp));
    assert(_map_same_pair_type_ex(&cpmap_first->_pair_temp, &cpmap_second->_pair_temp));

#ifdef CSTL_MAP_AVL_TREE
    return _avl_tree_less(&cpmap_first->_t_tree, &cpmap_second->_t_tree);
#else
    return _rb_tree_less(&cpmap_first->_t_tree, &cpmap_second->_t_tree);
#endif
}
예제 #4
0
/**
 * Tests if the first avl tree is greater than the second avl tree.
 */
bool_t _avl_tree_greater(const _avl_tree_t* cpt_first, const _avl_tree_t* cpt_second)
{
    return _avl_tree_less(cpt_second, cpt_first);
}
예제 #5
0
/**
 * Tests if the first avl tree is less than or equal to the second avl tree.
 */
bool_t _avl_tree_less_equal(const _avl_tree_t* cpt_first, const _avl_tree_t* cpt_second)
{
    return (_avl_tree_less(cpt_first, cpt_second) || _avl_tree_equal(cpt_first, cpt_second)) ? true : false;
}