From ba837332565a2b4a667bd1350a062e1007d4a5c4 Mon Sep 17 00:00:00 2001 From: Adam Carpenter <53hornet@gmail.com> Date: Sat, 3 Dec 2016 10:47:17 -0500 Subject: Uploading programming assignments -- typeset assignments may come later --- Assign5/table.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Assign5/table.hpp (limited to 'Assign5/table.hpp') 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); +}; -- cgit v1.2.3