diff options
Diffstat (limited to 'usr/src/uts/common/sys/avl.h')
-rw-r--r-- | usr/src/uts/common/sys/avl.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/usr/src/uts/common/sys/avl.h b/usr/src/uts/common/sys/avl.h index ba305c9..cc4af82 100644 --- a/usr/src/uts/common/sys/avl.h +++ b/usr/src/uts/common/sys/avl.h @@ -23,14 +23,13 @@ * Use is subject to license terms. */ -#ifndef _AVL_H -#define _AVL_H - /* - * This is a private header file. Applications should not directly include - * this file. + * Copyright (c) 2014 by Delphix. All rights reserved. */ +#ifndef _AVL_H +#define _AVL_H + #ifdef __cplusplus extern "C" { #endif @@ -39,9 +38,9 @@ extern "C" { #include <sys/avl_impl.h> /* - * This is a generic implemenatation of AVL trees for use in the Solaris kernel. - * The interfaces provide an efficient way of implementing an ordered set of - * data structures. + * This is a generic implementation of AVL trees for use in the illumos. The + * interfaces provide an efficient way of implementing an ordered set of data + * structures. * * AVL trees provide an alternative to using an ordered linked list. Using AVL * trees will usually be faster, however they requires more storage. An ordered @@ -53,7 +52,7 @@ extern "C" { * --------- -------- -------- * lookup O(n) O(log(n)) * - * insert 1 node constant constant + * insert 1 node constant O(log(n)) * * delete 1 node constant between constant and O(log(n)) * @@ -175,7 +174,7 @@ extern void avl_insert(avl_tree_t *tree, void *node, avl_index_t where); * Insert "new_data" in "tree" in the given "direction" either after * or before the data "here". * - * This might be usefull for avl clients caching recently accessed + * This might be useful for avl clients caching recently accessed * data to avoid doing avl_find() again for insertion. * * new_data - new data to insert @@ -260,6 +259,11 @@ extern boolean_t avl_update_lt(avl_tree_t *, void *); extern boolean_t avl_update_gt(avl_tree_t *, void *); /* + * Swaps the contents of the two trees. + */ +extern void avl_swap(avl_tree_t *tree1, avl_tree_t *tree2); + +/* * Return the number of nodes in the tree */ extern ulong_t avl_numnodes(avl_tree_t *tree); |