AVL_UPDATE(3AVL) | AVL Tree Library Functions | AVL_UPDATE(3AVL) |
avl_update
,
avl_update_gt
, avl_update_lt
— reinsert 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
avl_update
()
function re-inserts node into
tree only if its order has changed relative to its
nearest neighbors. To optimize performance,
avl_update_lt
()
checks only the previous node and
avl_update_gt
()
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
B_TRUE
if it was necessary to relocate the node due its order having changed
relative to its nearest neighbors and
B_FALSE
otherwise.
See the EXAMPLES section in libavl(3LIB).
See Locking in libavl(3LIB).
January 27, 2024 | OmniOS |