It's time to take our best shot at a design. The design will be a deliverable that would handoff to the coding team. Note that the design
does not need to be submitted with this assignment.
💡 Tip -- Designing and coding are both iterative (and may go back and fourth between the two).
This page describes the design that will be coded.
Object Diagram
HashTable
|
+------- buckets ------- DynamicArray
|
+------- maxLoadRatio -- an integer
|
+------- _size -- an integer
Design Notes:
Each bucket is a LinkedList (or DynamicArray)
The elements in each bucket are Association objects where each Association holds a key and value
The HashTable required instance methods are specified by the Dictionary ADT
We give the size component the name "_size" because we need to code a "size" method (a name collision on "size" would be problematic in some languages)
A good default length of the "buckets" array is 16 (if not specified by the constructor)
A good default for "maxLoadRatio" is 0.75 (if not specified by the constructor)
Data Structures And Algorithms (DSA)
(Chapter 602 - Hash Table Object Design)