Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWBTree
RWBTree RWCollection RWCollectable
Synopsis
Description
Persistence
Public Constructors
Public Member Operators
Public Member Functions
Synopsis
#include <rw/btree.h>
RWBTree a;
Description
Class RWBTree represents a group of ordered elements, not accessible by an external key.
Duplicates are not allowed. An object stored by class RWBTree must inherit abstract base class
RWCollectable -- the elements are ordered internally according to the value returned by virtual
function compareTo() (see class RWCollectable).
This class has certain advantages over class RWBinaryTree. First, the B-tree is automatically
balanced. (With class RWBinaryTree, you must call member function balance() explicitly to
balance the tree.) Nodes are never allowed to have less than a certain number of items (called
the order). The default order is 50, but may be changed by resetting the value of the static
constant "order" in the header file <btree.h> and recompiling. Larger values will result in
shallower trees, but less efficient use of memory.
Because many keys are held in a single node, class RWBTree also tends to fragment memory
less.