diff options
Diffstat (limited to 'Assign5/table.hpp')
-rw-r--r-- | Assign5/table.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Assign5/table.hpp b/Assign5/table.hpp new file mode 100644 index 0000000..e8c6336 --- /dev/null +++ b/Assign5/table.hpp @@ -0,0 +1,27 @@ +/* Header file containing definitions for the table object class. +Also contains the NODE structure for the linked list used for +separate chaining. NODE objects contain a key and a pointer to +another NODE representing the next node. I created a constant +called EMPTY that uses the int -1 to represent an empty slot in a table. +*/ +static const int EMPTY = -1; + +struct NODE { + int key; + NODE *next; +}; + +class Table { + private: + int tableArray[10]; + int unhashableList[10]; + bool unhashable; + NODE *tableHeads[10]; + public: + Table(bool); + void hashLinear(int[]); + void hashQuad(int[]); + void hashDouble(int[]); + void hashChaining(int[]); + void printTable(bool); +}; |