Question
Please develop a Java program to 1. Read records from pj5Data.csv file into 2 data structures: - java.util.TreeSet - a binary search tree data structure
Please develop a Java program to 1. Read records from pj5Data.csv file into 2 data structures: - java.util.TreeSet - a binary search tree data structure 2. Show the memory used by each of the above 2 data structures. 3. Read lines from passwordInput.txt and search them against the above 2 data structures. Repeat this search operation 4,000 times. 4. Show the CPU time used in the above search operations.
Please name your driver file/class as YourLastNamePJ5.java
The data file, pj5Data.csv, is a csv (comma separate value) file fields are separated by commas. Each line contains 2 fields: user Name and password. Listed below are some sample lines: carmella@aboulahoud.com, Aboulahoud clemente@aboulissan.com, Aboulissan
Each line in the file, passwordInput.txt, contains a user name (email address). Listed below are some sample lines:
jan@hariri.com amelia@harkavy.com
Objective: Compare the CPU and Memory efficiency between java.util.TreeSet and the binary search tree data structure.
Input files: pj5Data.csv and passwordInput.txt Assumption: - The number of records in pj5Data.csv is unknown. - Your program will skip/reject dirty data lines. For example, if a line contains 3 fields, it is considered as a dirty data line and will be rejected/skipped by your program.
Hint: This program generates 2 or 4 lines of output.
I use JGRASP so it has to be in one java file
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