summaryrefslogtreecommitdiff
path: root/usr/src/man/man3avl/avl_add.3avl
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-08-17 13:01:59 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-08-17 13:01:59 +0000
commit13fcc76fc02e61f38bddf48bd6ea621c69dff932 (patch)
tree5387d51d872b8d7dd94aba146d9fea2ed368b1ba /usr/src/man/man3avl/avl_add.3avl
parent9108c5e07330cfd63586277125b19ee25d543d94 (diff)
parent67b886e08e73a289a63ea9a98920f9ff423d1881 (diff)
downloadillumos-joyent-13fcc76fc02e61f38bddf48bd6ea621c69dff932.tar.gz
[illumos-gate merge]
commit 67b886e08e73a289a63ea9a98920f9ff423d1881 5934 localedef needs a native build (fix lint) commit fa9922c2be34868be01989cef133828185b5c0bc 5935 libavl should be a public interface 5936 AVL trees should be part of the DDI commit 7de0ac867568af5d9b8a9d8f8c82fd5fc12c6bfa 5934 localedef needs a native build commit 25b86e8fb6a2b50f929d8492cbac5d4eb5c2009a 5933 Makefile.man should take care of directory creation commit 22ff04516c85a5caac614d46031edbc085ba3a9e 6113 cpqary3: add support for hp gen9 smart array controllers commit d05c2e387bac9df4515e8771dbee0ef3f5fe121a 6121 Copy-paste bug in mac_init_rings() Conflicts: usr/src/man/Makefile.man usr/src/cmd/localedef/Makefile
Diffstat (limited to 'usr/src/man/man3avl/avl_add.3avl')
-rw-r--r--usr/src/man/man3avl/avl_add.3avl95
1 files changed, 95 insertions, 0 deletions
diff --git a/usr/src/man/man3avl/avl_add.3avl b/usr/src/man/man3avl/avl_add.3avl
new file mode 100644
index 0000000000..0ac7912264
--- /dev/null
+++ b/usr/src/man/man3avl/avl_add.3avl
@@ -0,0 +1,95 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2015 Joyent, Inc.
+.\"
+.Dd Apr 13, 2015
+.Dt AVL_ADD 3AVL
+.Os
+.Sh NAME
+.Nm avl_add ,
+.Nm avl_remove
+.Nd add and remove nodes from an AVL tree
+.Sh SYNOPSIS
+.Lb libavl
+.In sys/avl.h
+.Ft void
+.Fo avl_add
+.Fa "avl_tree_t *tree"
+.Fa "void *node"
+.Fc
+.Ft void
+.Fo avl_remove
+.Fa "avl_tree_t *tree"
+.Fa "void *node"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn avl_add
+and
+.Fn avl_remove
+functions add and remove objects from the AVL tree rooted at
+.Fa tree .
+.Pp
+The
+.Fn avl_add
+function inserts
+.Fa node
+into the tree.
+.Fa node
+must not already be in the tree, thus implying it must not compare equal
+to any other node in the tree. Adding
+.Fa node
+to
+.Fa tree
+will take
+.Sy O(log(n))
+time, as it implicitly determines where to place it in the tree.
+If
+.Fa node Ns 's
+location has already been determined by
+.Xr avl_find 3AVL ,
+then instead use
+.Xr avl_insert 3AVL .
+.Pp
+The
+.Fn avl_remove
+function removes
+.Fa node
+from the tree rooted at
+.Fa tree .
+.Fa node
+must be present in the tree, otherwise, the behavior is undefined.
+Deleting
+.Fa node
+from
+.Fa tree
+occurs in
+.Sy O(log(n))
+time.
+.Sh EXAMPLES
+See the
+.Sy EXAMPLES
+section in
+.Xr libavl 3LIB .
+.Sh INTERFACE STABILITY
+.Sy Committed
+.Sh MT-Level
+See
+.Sx Locking
+in
+.Xr libavl 3LIB .
+.Sh SEE ALSO
+.Xr libavl 3LIB ,
+.Xr avl_create 3AVL ,
+.Xr avl_insert 3AVL ,
+.Xr avl_insert_here 3AVL ,
+.Xr avl_destroy 3AVL