Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

Each line in the file, passwordInput.txt, contains a user name (email address).

You are required to 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.

Hint: This program generates 2 or 4 lines of output.

I use JGRASP so it has to be in one java file w/o package.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2 What supply is and what affects it.

Answered: 1 week ago