// ******************************************************** // Header file TableB.h for the ADT table. // Binary search tree implementation. // Assumption: A table contains at most one item with a // given search key at any time. // ******************************************************** #include "BST.h" // binary search tree operations typedef treeItemType tableItemType; class tableClass { public: tableClass(); // default constructor // copy constructor and destructor are // supplied by the compiler // table operations: virtual bool TableIsEmpty() const; virtual int TableLength() const; virtual void TableInsert(const tableItemType& NewItem, bool& Success); virtual void TableDelete(keyType SearchKey, bool& Success); virtual void TableRetrieve(keyType SearchKey, tableItemType& TableItem, bool& Success) const; virtual void TraverseTable(functionType Visit); protected: void SetSize(int NewSize); private: bstClass BST; // binary search tree that contains // the tableÕs items int Size; // number of items in the table }; // end class // End of header file.