Design a class called DoublyLinkedList (the class java file should be called DoublyLinkedList.java) that encodes an extended version of a doubly linked list, with the following (exact) fields and methods/constructors:
Fields and Methods | Description | |
Fields | Header | The header node |
Data | Link to the data | |
Next | Link to the next node | |
Back | Link to the node before | |
Methods | DoublyLinkedList | A constructor with no parameters that initialized the fields |
Insert | Insert a value (given by the parameter) into a new node in the list | |
Fetch | Fetch a value (given by the parameter) from the list | |
Delete | Delete a value (given by the parameter) from the list | |
Update | Update a value (given by the first parameter) from the list to a new value (given by the second parameter) | |
OutputForward | Output all the values from the list in forward order | |
OutputBackward | Output all the values from the list in backward order | |
OutputRecursive | A recursive method that output the list in forward order |
Design a class called LQHashed (the class java file should be called LQHashed.java) that implements an LQHashed data structure, with the following (exact) fields and methods/constructors:
Fields and Methods | Description | |
Fields | N | The size of the primary storage array |
Data | The primary storage array | |
DefaultQuotient | The default 4k+3 prime (9967) | |
LoadingFactor | The loading factor (default 0.75) | |
Size | Number of nodes in the structure | |
Methods | LQHashed | A constructor with no parameters that initialized the fields and use the parameter as the length fo the 4k+3 algorithm |
Insert | Insert a value (given by the parameter) into a new node in the hashed | |
Fetch | Fetch a value (given by the parameter) from the hashed | |
Delete | Delete a value (given by the parameter) from the hashed | |
Update | Update a value (given by the first parameter) from the list to a new value (given by the second parameter) | |
Output | Output all the values from the hashed |
After you design the DoublyLinkedList, and LQHashed. Please design a program/project/driver class which is called MAIN, that will create an object of both of the classes, and the functionality of both classes. Also, add the DoublyLinkedList and LQHashed to the MAIN project, and add the code to the project/driver class.