Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this question, we will use java to implement the algorithms mentioned in this question: https://www.chegg.com/homework-help/questions-and-answers/course-algorithms-data-structure-based-question-answer-https-wwwcheggcom-homework-help-que-q107659115 Course: algorithms of data structure Send a picture of

In this question, we will use java to implement the algorithms mentioned in this question: https://www.chegg.com/homework-help/questions-and-answers/course-algorithms-data-structure-based-question-answer-https-wwwcheggcom-homework-help-que-q107659115

Course: algorithms of data structure

Send a picture of the code and write with it a comment

(picture attached) myData.csv: a CSV file of student marks (first name, last name, mark). excel sheet of the question, please note it contains three columns (the first column is the first name, the second column is the last name and the third column is the mark) it has also 1048576 rows. here is a part of the excel please let me know if any other is needed.

Student.jav: contains Class Student, which has 3 fields (firstName, lastName, mark) and several useful methods

Main.java: the main running file, which has the following useful functions (attached with picture)

readStudents: a function for reading the attached csv file into a Vector of class Student. (attached with picture)

getTestingData: a function for generating testing data from the original data set

find1: a function that finds a student mark using first name and last name using the naive approach (searching the full list of students one by one until it finds a student with exact first and last name)

main: a function that computes the running time of the naive approach.

Your goal is to find out which approach is the fastest for finding a student by both first and last names. You shall do the following:

implement Kimo approach

implement Shadi approach

implement a third approach that uses a hashtable where the key is class Student and the value is the mark (hint: you will need to override hashcode and equals of Student).

What are the running times of all 4 approaches (the above 3 approaches and the naive approach) following the same method outline in function main? Which one is fastest?

please make sure that the answer is correct, I will vote up and write a good review for sure if the answer is correct. needed urgently Thanks

image text in transcribed
image text in transcribed
image text in transcribed
inport 1ava.util."; Inoget jama, to, F1ley public class Main of Systeen, out,peintini "Head input file ") Bandon . rando = nev Randen [314]3 deuble seblepercectage = 8. 0a1s Wectorestudents testing = zet Testinglata(students, randon, sasplepercentage); Systee, out-peinthi "denerated testing data =ig long start = Systen , currenttinetidits i ; 10s=aj fort- Studere s.1 testing ) I findi (4, students ) : long time = Systen, currentinewdilis: - = starty Syotew, out-pelntin( "the elapsed: =+ the if Fi cratate a ravple of the data for recting Wectorestudents testing w ther Vectord forf - stusent s : students)f double p. = random, nextbouble(): If (psinp] ePercentage ) testing add ( 5 in return testingt)

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: 3

blur-text-image

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions