The Tree Implementation
[The Implementations]

The tree implemenation. More...


Functions

EAPI Cmaid_Setcmaid_tree_set_new (const Cmaid_Value *key)
 Creates a new set using the tree implementation.
EAPI Cmaid_Mapcmaid_tree_map_new (const Cmaid_Value *key, const Cmaid_Value *val)
 Creates a new map using the tree implementation.

Variables

EAPI const Cmaid_Set_Interface cmaid_tree_set_if
EAPI const Cmaid_Map_Interface cmaid_tree_map_if
EAPI const Cmaid_Iter_Interface cmaid_tree_key_iter_if
EAPI const Cmaid_Iter_Interface cmaid_tree_value_iter_if


Detailed Description

The tree implemenation.

The tree implementation is a red-black tree. It is lexically ordered. The operations for insertion, removes and look-ups, is guaranteed to be O(log N). The average memory usage is higher then for hash table. Hence it is preferable in most cases to use a hash table, as long as you don't need the lexically order or a good hash function is hard to figure out.


Function Documentation

EAPI Cmaid_Map* cmaid_tree_map_new ( const Cmaid_Value key,
const Cmaid_Value value 
)

Creates a new map using the tree implementation.

Parameters:
key The value structure defining the type of the objects used for the key object.
value The value structure defining the type of the objects used for the value object.
Returns:
Returns a newly allocated map, an allocation error occurs, NULL is returned. This functions is creating a map with the tree as implementation.

EAPI Cmaid_Set* cmaid_tree_set_new ( const Cmaid_Value v  ) 

Creates a new set using the tree implementation.

Parameters:
v The value structure defining the type of the objects used in the set
Returns:
Returns a newly allocated set, an allocation error occurs, NULL is returned This functions is creating a set with the tree as implementation.


Generated on Wed Aug 5 00:20:50 2009 for Cmaid by  doxygen 1.5.8