Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::genstruct::SortedBinTree< T, C > Class Template Reference

#include <elm/genstruct/SortedBinTree.h>

+ Inheritance diagram for elm::genstruct::SortedBinTree< T, C >:

Additional Inherited Members

- Public Member Functions inherited from elm::genstruct::GenSortedBinTree< T, IdAdapter< T >, C >
 GenSortedBinTree (void)
 
 ~GenSortedBinTree (void)
 
int count (void) const
 
bool contains (const T &value) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
void clear (void)
 
void add (const T &value)
 
void addAll (const S< T > &items)
 
void remove (const T &value)
 
void remove (const Iterator &iter)
 
void removeAll (const S< T > &items)
 
const T * look (const typename IdAdapter< T >::key_t &key) const
 
T * look (const typename IdAdapter< T >::key_t &key)
 

Detailed Description

template<class T, class C = Comparator<T>>
class elm::genstruct::SortedBinTree< T, C >

This class provides a collection implementation as a sorted binary tree. Whatever the performed action (lookup, insertion or deletion), it has an average complexity of O(log(n)) with a worst case of O(n). The worst case is reached if the items are inserting in order. Notice that no method of this class is implemented recursively.

This class implements the concept of concept::MutableCollection.

Parameters
TType of items in the data structure.
CType describing the comparison operation (must implement elm::concept::Comparator<T>, elm::Comparator<T> as a default).

The documentation for this class was generated from the following file: