[#BloombergLP-bslalg-RbTreeUtil-remove]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RbTreeUtil.adoc[RbTreeUtil]::remove
:relfileprefix: ../../../
:mrdocs:

Remove `node` from `tree` and rebalance the tree&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;rbtreeutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
remove(
    xref:BloombergLP/bslalg/RbTreeAnchor.adoc[RbTreeAnchor]* tree,
    xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode]* node);
----

== Description

Remove the specified `node` from the specified `tree`, and then rebalance `tree` so that it again forms a valid red&hyphen;black tree (see `validateRbTree`)&period; The behavior is undefined unless `tree` is well&hyphen;formed (see `isWellFormed`)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *tree*
| well&hyphen;formed tree from which `node` is removed
| *node*
| node to remove from `tree`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
