AVL_UPDATE(3AVL) AVL Tree Library Functions AVL_UPDATE(3AVL)

avl_update, avl_update_gt, avl_update_ltreinsert a node if its order has changed

AVL Tree Library (libavl, -lavl)
#include <sys/avl.h>

boolean_t
avl_update(avl_tree_t *tree, void *node);

boolean_t
avl_update_gt(avl_tree_t *tree, void *node);

boolean_t
avl_update_lt(avl_tree_t *tree, void *node);

The () function re-inserts node into tree only if its order has changed relative to its nearest neighbors. To optimize performance, () checks only the previous node and () checks only the next node. Use avl_update_lt() and avl_update_gt() only if you know the direction in which the order of the node may change.

The avl_update(), avl_update_lt() and avl_update_gt() functions return if it was necessary to relocate the node due its order having changed relative to its nearest neighbors and otherwise.

See the EXAMPLES section in libavl(3LIB).

See Locking in libavl(3LIB).

libavl(3LIB)

January 27, 2024 OmniOS