tableb.h

来自「Data Abstraction & Problem Solving with 」· C头文件 代码 · 共 39 行

H
39
字号
// ********************************************************// 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#include "TableException.h"typedef TreeItemType TableItemType;class Table{public:   Table();  // 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);   virtual void tableDelete(KeyType searchKey)                            throw(TableException);   virtual void tableRetrieve(KeyType searchKey,                            TableItemType& tableItem) const                            throw(TableException);   virtual void traverseTable(FunctionType visit);protected: void setSize(int newSize);private:   BinarySearchTree bst; // binary search tree that contains                         // the table誷 items   int           size;   // number of items in the table};  // end Table class// End of header file.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?