Question
Using the java.util.HashMap as a starting point, implement a Hashtable class that keeps the chains in ArrayList objects instead of linked lists. Make the following
Using the java.util.HashMap as a starting point, implement a Hashtable class that keeps the chains in ArrayList objects instead of linked lists. Make the following additional changes as compared to java.util.HashMap:
(a) Add a constructor that accepts an initial capacity as well as an increment by which a table will grow every time a rehash is done. (That is, if the client uses this constructor, rehash does not automatically double the table size.)
(b) Implement all other methods as appropriate to account for the ArrayList usage, as well as the new table size increment option.
Analyze the worst-case and average big O running times of search, insert, and delete in your Hashtable class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started