Question: Please develop a Java program to compare the CPU and Memory efficiency between java.util.TreeSet and java.util.HashSet by doing the following; 1. Read records from a

Please develop a Java program to compare the CPU and Memory efficiency between java.util.TreeSet andjava.util.HashSet by doing the following;

1. Read records from a .csv file into 2 data structures:

java.util.TreeSet

java.util.HashSet

2. Show the memory used by each of the above 2 data structures.

3. Read lines from a .txt file and search them against the above 2 data structures.

Repeat this search operation

4. Show the CPU time used in the above search operations.

Below are details about the two files:

The .csv file contains a username and password. Below are some sample records:

carmella@aboulahoud.com, Aboulahoud

clemente@aboulissan.com, Aboulissan

The .txt file contains a password. Below are some sample records:

nicky@hartzler.com

carmel@harvest.com

(I can't attach the files so just copy/paste the samples onto .txt and .csv)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!