* Comparison callback. Must return < 0, 0, or > 0 if the first argument
* is less than, equal to, or greater than the second argument,
* respectively. The first argument will be @cmp_ctx and the second
- * argument will be a pointer to the AVL tree node contained in the item
- * inserted into the AVL tree.
+ * argument will be a pointer to the AVL tree node of an item in the tree.
*
* Returns a pointer to the AVL tree node embedded in the resulting item, or
* NULL if the item was not found.
* balance(A) = -2
* balance(B) = +1
* Let x = height(C). Then:
- * height(A)
* height(B) = x + 2
* height(E) = x + 1
* height(D) = x
avl_set_balance_factor(X, Y_balance_factor);
}
-/* Removes the specified @node from the AVL tree whose root is pointed to by
- * @root_ptr.
+/* Removes the specified @node from the AVL tree. @root_ptr must point to the
+ * pointer to the root node of the tree; *root_ptr may change if the tree is
+ * rebalanced.
*
- * This *only* unlinks the node and rebalances the tree; it does not free any
- * memory or anything. */
+ * This *only* removes the node and rebalances the tree; it does not free
+ * memory, nor does it do the equivalent of avl_tree_node_set_unlinked(). */
void
avl_tree_remove(struct avl_tree_node **root_ptr, struct avl_tree_node *node)
{