AVL_ADD(3AVL) AVL Tree Library Functions AVL_ADD(3AVL)

## NAME

**avl_add**, **avl_remove **- add and remove nodes from an AVL tree

## SYNOPSIS

AVL Tree Library (libavl, -lavl)

**#include <sys/avl.h>**

__void__

**avl_add**(__avl_tree_t__ __*tree__, __void__ __*node__);

__void__

**avl_remove**(__avl_tree_t__ __*tree__, __void__ __*node__);

## DESCRIPTION

The**avl_add**() and **avl_remove**() functions add and remove objects from the

AVL tree rooted at__tree__.

The**avl_add**() function inserts __node__ into the tree. __node__ must not already

be in the tree, thus implying it must not compare equal to any other node

in the tree. Adding__node__ to __tree__ will take **O(log(n)) **time, as it

implicitly determines where to place it in the tree. If__node__'s location

has already been determined by avl_find(3AVL), then instead use

avl_insert(3AVL).

The**avl_remove**() function removes __node__ from the tree rooted at __tree__. __node__

must be present in the tree, otherwise, the behavior is undefined.

Deleting__node__ from __tree__ occurs in **O(log(n)) **time.

## EXAMPLES

See the**EXAMPLES **section in libavl(3LIB).

## INTERFACE STABILITY

**Committed**

**MT-Level**

See__Locking__ in libavl(3LIB).

## SEE ALSO

avl_create(3AVL), avl_destroy(3AVL), avl_insert(3AVL),

avl_insert_here(3AVL), libavl(3LIB)

illumos April 13, 2015 illumos

AVL Tree Library (libavl, -lavl)

The

AVL tree rooted at

The

be in the tree, thus implying it must not compare equal to any other node

in the tree. Adding

implicitly determines where to place it in the tree. If

has already been determined by avl_find(3AVL), then instead use

avl_insert(3AVL).

The

must be present in the tree, otherwise, the behavior is undefined.

Deleting

See the

See

avl_create(3AVL), avl_destroy(3AVL), avl_insert(3AVL),

avl_insert_here(3AVL), libavl(3LIB)

illumos April 13, 2015 illumos