* 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)
{