Tools.h++ Manual
104011 Tandem Computers Incorporated 21-181
21
RWSortedVector
RWSortedVector
|
RWOrdered
|
RWSequenceable
|
RWCollection
|
RWCollectable
Synopsis
#include <rw/sortvec.h>
RWSortedVector a;
Description Class
RWSortedVector
represents a group of ordered items, internally sorted
by the
compareTo()
function and accessible by an index number. Duplicates
are allowed. An object stored by
RWSortedVector
must inherit from the
abstract base class
RWCollectable
. An insertion sort is used to maintain the
vector in sorted order.
Because class
RWSortedVector
is implemented as a vector of pointers,
traversing the collection is more efficient than with class
RWBinaryTree
.
However, insertions are slower in the center of the collection.