Question: Initialization and Data Input: Prompt the user for the name of the initial data file. Read the first data file and ensure the list is
Initialization and Data Input:
Prompt the user for the name of the initial data file.
Read the first data file and ensure the list is maintained in order based on RecordID values.
Handle errors if the file is not accessible or no valid data is found.
Initialize an ordered linked list
OrderedMULinkedList
to store the records during initial reading and subsequent merging and purging operations.
Determine the initial size of the hash table based on the amount of data read.
User Option Loop:
Implement a loop to provide options to the user: output, sort, find, efficiency, merge, purge, records, hash table, or quit.
Prompt the user for their choice and execute the corresponding action.
Merge Operation:
If the user selects merge:
Prompt the user for the name of a file to merge.
Read the merge file, following the same rules for invalid data and duplicate records.
Merge valid records with non
duplicate data into the existing database, keeping the records sorted by RecordID values.
Create emission and petroleum reduction columns for merged data.
Replace the ordered linked list of data with a new one reflecting the merged data.
Update the hash table accordingly.
Purge Operation:
If the user selects purge:
Prompt the user for the name of a file to purge.
Read the purge file, following the same rules for invalid data and duplicate records.
Purge
delete
records from the database with RecordIDs matching those from the purge file.
Update the data structure accordingly.
Replace the ordered linked list of data with a new one reflecting the purged data.
Update the hash table accordingly.
Output Records:
If the user selects
r
:
Prompt the user for an output filename.
Traverse the ordered linked list of data and print each record in the order it is found, followed by the same summary line as for output.
Provide the option to print to standard output if no filename is specified.
Hash Table Display:
If the user selects
h
:
Traverse the hash table and display each bucket's contents in the specified format, including overflow items if any.
Include information about the hash table's base capacity, total capacity, and load factor.
Prompt the user for an output filename and send the output to the standard out console if no filename is provided.
Hash Table Implementation:
Implement a hash table using an array of OrderedMULinkedLists.
Define a hash function to determine the bucket for each RecordID.
Handle collisions through separate chaining.
Implement resizing of the hash table based on load factor thresholds.
Design Document:
Create a design document
PDF
named
EV
Designpdf
containing:
Description of chosen hash function and collision resolution strategy.
Analysis of how these alternatives would influence code complexity and efficiency.
Efficient Mutator Methods:
Ensure efficient mutator methods and handle memory availability checks.
Object
Oriented Design:
Utilize proper object
oriented design principles, including encapsulation, inheritance, overloading, overriding, and accessibility modifiers.
Code Documentation:
Provide header comments for all classes and methods.
Include explanatory comments for each code section.
Use meaningful variable and method names.
Maintain consistent indentation and adhere to coding conventions.
can you make this code and do it in java please
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
