Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

below: public class Student { public String name; public int ID; public int grade; public Student(String nm, int id, int g) { name= nm; ID=

image text in transcribed
image text in transcribed
below:
public class Student
{
public String name;
public int ID;
public int grade;
public Student(String nm, int id, int g)
{
name= nm;
ID= id;
grade= g;}
publicString toString() {
return String.format
(
"[Name: %1$s, ID: %2$d, Grade: %3$d]", name, ID, grade);
}
}
COMP 3040 Data Structures Lab 9/5/2018 Instruction: Download sorting Time.java program. Modify the code according to the hints in the program so that you can test all 3 sorting algorithms and the Binary Search algorithm, respectively a) Run the 3 sorting algorithms for array size 1000, 5000, and 10000, respectively. Record the running times on an Excel spreadsheet. Draw curve chart to compare the times Bubble 1000 5000 b) Modify insertionSort (slide 38) so that it can sort array of Student objects by grade. Test your code in the main method. The definition of the class Student is provided as below public class Student public String name public int ID public int grade; public Student (String nm, int id, int g) name = nm; IDid grade g; public String tostring() String. format( "[Name: name, %1$s, ID: %25d- return %35d]", Grade: ID, grade); The following is an example of running page of 10 students

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions