📄 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#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -