avl.h File Reference

#include "common.h"
#include "collection.h"
#include "vector.h"
#include "mempool.h"

Go to the source code of this file.

Data Structures

struct  _cp_avlnode
struct  _cp_avltree
#define cp_avltree_rdlock(tree)   (cp_avltree_lock((tree), COLLECTION_LOCK_READ))
#define cp_avltree_wrlock(tree)   (cp_avltree_lock((tree), COLLECTION_LOCK_WRITE))
typedef CPROPS_DLL struct
_cp_avlnode 
cp_avlnode
typedef CPROPS_DLL struct
_cp_avltree 
cp_avltree
CPROPS_DLL cp_avlnode * cp_avlnode_create (void *key, void *value, cp_mempool *mempool)
CPROPS_DLL void cp_avltree_destroy_node (struct _cp_avltree *tree, cp_avlnode *node)
CPROPS_DLL void cp_avltree_destroy_node_deep (struct _cp_avltree *owner, cp_avlnode *node)
CPROPS_DLL cp_avltree * cp_avltree_create (cp_compare_fn cmp)
CPROPS_DLL cp_avltree * cp_avltree_create_by_option (int mode, cp_compare_fn cmp, cp_copy_fn key_copy, cp_destructor_fn key_dtr, cp_copy_fn val_copy, cp_destructor_fn val_dtr)
CPROPS_DLL void cp_avltree_destroy (cp_avltree *tree)
CPROPS_DLL void cp_avltree_destroy_custom (cp_avltree *tree, cp_destructor_fn key_dtr, cp_destructor_fn val_dtr)
CPROPS_DLL void * cp_avltree_insert (cp_avltree *tree, void *key, void *value)
CPROPS_DLL void * cp_avltree_get (cp_avltree *tree, void *key)
CPROPS_DLL void * cp_avltree_find (cp_avltree *tree, void *key, cp_op op)
CPROPS_DLL int cp_avltree_contains (cp_avltree *tree, void *key)
CPROPS_DLL void * cp_avltree_delete (cp_avltree *tree, void *key)
CPROPS_DLL int cp_avltree_callback_preorder (cp_avltree *tree, cp_callback_fn callback, void *prm)
CPROPS_DLL int cp_avltree_callback (cp_avltree *tree, cp_callback_fn callback, void *prm)
CPROPS_DLL int cp_avltree_callback_postorder (cp_avltree *tree, cp_callback_fn callback, void *prm)
CPROPS_DLL int cp_avltree_count (cp_avltree *tree)
CPROPS_DLL int cp_avltree_lock (cp_avltree *tree, int type)
CPROPS_DLL int cp_avltree_unlock (cp_avltree *tree)
CPROPS_DLL int cp_avltree_get_mode (cp_avltree *tree)
CPROPS_DLL int cp_avltree_set_mode (cp_avltree *tree, int mode)
CPROPS_DLL int cp_avltree_unset_mode (cp_avltree *tree, int mode)
CPROPS_DLL void cp_avltree_dump (cp_avltree *tree)
CPROPS_DLL int cp_avltree_use_mempool (cp_avltree *tree, cp_mempool *pool)
CPROPS_DLL int cp_avltree_share_mempool (cp_avltree *tree, cp_shared_mempool *pool)


Detailed Description

avl tree definitions

avl is a height balanced binary tree. Named after G. M. Adelson-Velskii and E. M. Landis who introduced the data structure in an 1962 article "An algorithm for the organization of information".

The delete and insert method implementations are recursive.

Definition in file avl.h.


Generated on Mon Dec 5 23:00:22 2011 for cprops by  doxygen 1.4.7