| | | | | |

Ordered Table API

// classic Table ops
void      Insert     (const KeyType& key, const DataType data); 
Iterator  Includes   (const KeyType& key) const;

// associative array ops
void      Put        (const KeyType& key, const DataType data); // same as Insert
DataType& Get        (const KeyType& key); // "insert if necessary and retrieve" semantics
bool      Retrieve   (const KeyType& key, DataType& data) const;

// ordered table ops
Iterator  LowerBound (const KeyType& key) const;
Iterator  UpperBound (const KeyType& key) const;

// eliminating elements {Remove} or {Erase and Rehash}
bool      Remove     (const KeyType& key);
bool      Erase      (const KeyType& key);
void      Rehash     ();

// size operations
bool      Empty      ()   const;
size_t    Size       ()   const;
void      Clear      ();  // make empty

// plus the usual support system:
//   logical operators ==(), !=()
//   iterator support for bidirectional iterators
//   Big 4: Constructor, Destructor, Copy Constructor, Assignment Operator

| | Top of Page | 12. Binary Search Trees - 35 of 41