Print this page
4745 fix AVL code misspellings

*** 35,53 **** * * This relaxation from a perfectly balanced binary tree allows doing * insertion and deletion relatively efficiently. Searching the tree is * still a fast operation, roughly O(log(N)). * ! * The key to insertion and deletion is a set of tree maniuplations called * rotations, which bring unbalanced subtrees back into the semi-balanced state. * * This implementation of AVL trees has the following peculiarities: * * - The AVL specific data structures are physically embedded as fields * in the "using" data structures. To maintain generality the code * must constantly translate between "avl_node_t *" and containing ! * data structure "void *"s by adding/subracting the avl_offset. * * - Since the AVL data is always embedded in other structures, there is * no locking or memory allocation in the AVL routines. This must be * provided for by the enclosing data structure's semantics. Typically, * avl_insert()/_add()/_remove()/avl_insert_here() require some kind of --- 35,53 ---- * * This relaxation from a perfectly balanced binary tree allows doing * insertion and deletion relatively efficiently. Searching the tree is * still a fast operation, roughly O(log(N)). * ! * The key to insertion and deletion is a set of tree manipulations called * rotations, which bring unbalanced subtrees back into the semi-balanced state. * * This implementation of AVL trees has the following peculiarities: * * - The AVL specific data structures are physically embedded as fields * in the "using" data structures. To maintain generality the code * must constantly translate between "avl_node_t *" and containing ! * data structure "void *"s by adding/subtracting the avl_offset. * * - Since the AVL data is always embedded in other structures, there is * no locking or memory allocation in the AVL routines. This must be * provided for by the enclosing data structure's semantics. Typically, * avl_insert()/_add()/_remove()/avl_insert_here() require some kind of
*** 92,102 **** #include <sys/debug.h> #include <sys/avl.h> #include <sys/cmn_err.h> /* ! * Small arrays to translate between balance (or diff) values and child indeces. * * Code that deals with binary tree data structures will randomly use * left and right children when examining a tree. C "if()" statements * which evaluate randomly suffer from very poor hardware branch prediction. * In this code we avoid some of the branch mispredictions by using the --- 92,102 ---- #include <sys/debug.h> #include <sys/avl.h> #include <sys/cmn_err.h> /* ! * Small arrays to translate between balance (or diff) values and child indices. * * Code that deals with binary tree data structures will randomly use * left and right children when examining a tree. C "if()" statements * which evaluate randomly suffer from very poor hardware branch prediction. * In this code we avoid some of the branch mispredictions by using the
*** 112,122 **** * Walk from one node to the previous valued node (ie. an infix walk * towards the left). At any given node we do one of 2 things: * * - If there is a left child, go to it, then to it's rightmost descendant. * ! * - otherwise we return thru parent nodes until we've come from a right child. * * Return Value: * NULL - if at the end of the nodes * otherwise next node */ --- 112,123 ---- * Walk from one node to the previous valued node (ie. an infix walk * towards the left). At any given node we do one of 2 things: * * - If there is a left child, go to it, then to it's rightmost descendant. * ! * - otherwise we return through parent nodes until we've come from a right ! * child. * * Return Value: * NULL - if at the end of the nodes * otherwise next node */
*** 917,927 **** #define CHILDBIT (1L) /* * Post-order tree walk used to visit all tree nodes and destroy the tree ! * in post order. This is used for destroying a tree w/o paying any cost * for rebalancing it. * * example: * * void *cookie = NULL; --- 918,928 ---- #define CHILDBIT (1L) /* * Post-order tree walk used to visit all tree nodes and destroy the tree ! * in post order. This is used for destroying a tree without paying any cost * for rebalancing it. * * example: * * void *cookie = NULL;