This struct provides a namespace for a suite of utility functions that operate on elements of type RbTreeNode.

Synopsis

Declared in <bslalg_rbtreeutil.h>

struct RbTreeUtil;

Description

Each method of this class, other than copyTree, provides the no‐throw exception guarantee if the client‐supplied comparator provides the no‐throw guarantee, and provides the strong guarantee otherwise (see bsldoc_glossary). copyTree provides the strong guarantee.

Static Member Functions

Name

Description

copyTree

Copy original into empty result using nodeFactory.

deleteTree

Destroy every node in tree and reset it to empty.

find

find overloads

findInsertLocation

findInsertLocation overloads

findUniqueInsertLocation

findUniqueInsertLocation overloads

insert

Insert newNode into tree according to comparator.

insertAt

Insert newNode under parentNode and rebalance tree.

isLeftChild

Return whether node is the left child of its parent.

isRightChild

Return whether node is the right child of its parent.

isWellFormed

Return whether tree is a well‐formed valid red‐black tree.

leftmost

Return the address of the leftmost node in the specified subtree.

lowerBound

lowerBound overloads

moveTree

Move nodes from original into empty result.

next

Return the in‐order successor of the specified node.

previous

Return the in‐order predecessor of the specified node.

printTreeStructure

Write a human‐readable description of subtree to file.

remove

Remove node from tree and rebalance the tree.

rightmost

rightmost overloads

rotateLeft

Rotate node counter‐clockwise about its right child.

rotateRight

Rotate node clockwise about its left child.

swap

Exchange the nodes of the specified a and b trees.

upperBound

Return the first node ordered after value, or the sentinel.

validateRbTree

validateRbTree overloads

Created with MrDocs