Compare the CPU and memory efficiency between HashSet and TreeSet

Compare the CPU and memory efficiency between HashSet and TreeSet

Please name your Java file/class as vatturiQZ3.java

Objective: Compare the CPU and memory efficiency between HashSet and TreeSet

Input files: qz3Data.csv and qz3ID.txt

Assumption: The number of records in qz3Data.csv is unknown

The data file “qz3Data.csv” is a csv (comma separate value) file and contains 6 fields, separated by commas, on each line:

ID, City, State, Zip Code, Amount, Date

Listed below are some sample lines:

71300cc5-d751-57c9-ba81-4a69e48745d1,Bisuhub,RI,53353,$6534.03,09/08/2070

78f52baf-91fe-5861-9659-24f38a539018,Dekgiihi,GA,13754,$776.26,03/04/1916

You are required to develop a Java program to:

1. Read all data records from qz3Data.csv file into java.util.HashSet and java.util.TreeSet.

2. Display the memory used by HashSet created in step 1.

3. Display the memory used by TreeSet created in step 1.

4. Read one ID from qz3ID.txt and search against HashSet created in the step 1. Repeat this operation for all IDs in qz3ID.txt. Display the CPU Time used for this operation.

5. Read one ID from qz3ID.txt and search against TreeSet created in the step 1. Repeat this operation for all IDs in qz3ID.txt. Display the CPU Time used for this operation.

Hint: This program generates 4 lines of output.

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper