diff options
author | Adam Carpenter <53hornet@gmail.com> | 2016-12-03 10:47:17 -0500 |
---|---|---|
committer | Adam Carpenter <53hornet@gmail.com> | 2016-12-03 10:47:17 -0500 |
commit | ba837332565a2b4a667bd1350a062e1007d4a5c4 (patch) | |
tree | 09e53b8bd9db8cb426d38826ebca1e68e376994a /Assign5/table.hpp | |
download | csci303-master.tar.xz csci303-master.zip |
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); +}; |