// Chap 11, pp 528 - 529 // Rename this file as TableB.h. // ******************************************************** // 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: // constructors and destructor: tableClass(); tableClass(const tableClass& T); virtual ~tableClass(); // table operations: virtual int TableLength(); virtual boolean TableIsEmpty(); virtual void TableInsert(tableItemType NewItem, boolean& Success); virtual void TableDelete(keyType SearchKey, boolean& Success); virtual void TableRetrieve(keyType SearchKey, tableItemType& TableItem, boolean& Success); 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.