Containers

The Xavax C++ Library (libCx) provides the following containers.

DList<T> stores objects by value in a double-linked list and is best used when objects must be inserted or removed at a location other than the list head or tail. DListIterator<T> and DListConstIterator<T> are used to iterate over a DList<T>. DList<T> has O(N/2) performance when searching by value or position.
SList<T> stores objects by value in a single-linked list and is best used when objects are only inserted or removed at the list head or tail. SListIterator<T> and SListConstIterator<T> are used to iterate over an SList<T>. SList<T> has O(N/2) performance when searching by value or position.
Tree<T> stores objects by value in a balanced binary tree and is best used when the number of objects (N) in the container is large and retrieval time must be minimized. TreeIterator<T> and TreeConstIterator<T> are used to iterate over a Tree<T>. Tree<T> has O(log2N) performance when searching by value or position.
PDList<T> is similar to DList<T> but stores objects by reference (pointers to objects). PDListIterator<T> and PDListConstIterator<T> are used to iterate over a PDList<T>.
PSList<T> is similar to SList<T> but stores objects by reference. PSListIterator<T> and PSListConstIterator<T> are used to iterate over a PSList<T>.
PTree<T> is similar to Tree<T> but stores objects by reference. PTreeIterator<T> and PTreeConstIterator<T> are used to iterate over a PTree<T>.

Containers that store elements of type T by value require that type T provide a copy constructor and implement operator=. For best performance, the client should provide a compare functor when a container is used to store a sorted collection.

770-609-5972 XAVAX info@xavax.com