cp_avltree

Section: libcprops - cp_avltree (3)
Updated: MAY 2006
Index Return to Main Contents [view source]
 

NAME

cp_avltree - an AVL tree implementation

 

DESCRIPTION

cp_avltree is a general purpose AVL tree implementation. AVL trees are height balanced binary trees with a guaranteed lookup complexity of O(log n). Instances may be created with a specifiable degree of internal or external synchronization and entry memory management.

A tree is created with cp_avltree_create_by_option(3) and deallocated with cp_avltree_destroy(3). After creation behavior may be changed by calling cp_avltree_unset_mode(3) to set and unset mode bits. Mappings may be added with cp_avltree_insert(3), retrieved with cp_avltree_delete(3). For more details see the documentation for specific functions.

 

INTERFACE

the following is a summary of functions provided by <cprops/avl.h>.

cp_avltree *cp_avltree_create(cp_compare_fn cmp);
cp_avltree *
      cp_avltree_create_by_option(int mode,
                                  cp_compare_fn compare_fn,
                                  cp_copy_fn copy_key,
                                  cp_destructor_fn free_key);
                                  cp_copy_fn copy_value
                                  cp_destructor_fn free_value);

void cp_avltree_destroy(cp_avltree *tree);
void cp_avltree_destroy_custom(cp_avltree *tree,
                                cp_destructor_fn dk,
                                cp_destructor_fn dv);

void *cp_avltree_insert(cp_avltree *tree, void *key, void *value);
void *cp_avltree_get(cp_avltree *tree, void *key);
void *cp_avltree_delete(cp_avltree *tree, void *key);
int cp_avltree_contains(cp_avltree *tree, void *key);
long cp_avltree_count(cp_avltree *tree);

int cp_avltree_get_mode(cp_avltree *tree);
void cp_avltree_set_mode(cp_avltree *tree, int mode);
void cp_avltree_unset_mode(cp_avltree *tree, int mode);

int cp_avltree_lock(cp_avltree *tree, int type);
int cp_avltree_unlock(cp_avltree *tree);
int cp_avltree_rdlock(cp_avltree *tree);
int cp_avltree_wrlock(cp_avltree *tree);

 

SEE ALSO

cp_avltree_create(3), cp_avltree_insert(3), cp_avltree_lock(3), cp_avltree_set_mode(3), cprops(3)


 

Index

NAME
DESCRIPTION
INTERFACE
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 12:01:45 GMT, May 23, 2006
SourceForge.net Logo