Question: Sorting and Searching Write a program that takes the student array, generated from the course roster for this course at the time the assignment was

Sorting and Searching

Write a program that takes the student array, generated from the course roster for this course at the time the assignment was created, and sorts the array by first name. The list is provided as a csv file. Read in the file, store it in an array.

Create three separate sorted arrays that are sorted using three different sorting algorithms.

Each method call should count the number of data swaps that occur within the algorithm and output the counts for each algorithm and which sort resulted in the fewest number of swaps. The easiest way to do this would be to create a swap method that is used for all three algorithms and three methods(one for each algorithm) and within each method, everytime the swap method is called, add one to that counter.

You will also need to create a Student class that stores the three values and then store each student in the array.

Once you have sorted the arrays, use any of the sorted arrays to conduct a search, using both sequential search and binary search. You should search for the same value for both searches and count the number of comparisons for each search.

Output a second result that shows the number of comparisons for each search and which resulted in the fewest number of comparisons.

Roster below:

Sorting and Searching Write a program that takes the student array, generated

1 Aaberg Ti tjaaber 2 Dorang Ryan rdorang 3 Garapati Satya spgarap 4 Johansen Kaleigh ksjohan 5 Kennedy Dayna dakenn2 6 Leoni James jwleoni 7 Licking Makenna mmlicki 8 Lohmar Jack jclohm1 9 Martinez Alexandro amart64 10 Mennel Michaela mhmenne 11 Miranda Richard rmirand 12 Mozdzen Konrad kcmozdz 13 Pecoraro Andrew ampeco1 14 Sanders Christine crsand2 15 Schmidt Scott sschmi2 Rachel rnunger 16 Unger 1 Aaberg Ti tjaaber 2 Dorang Ryan rdorang 3 Garapati Satya spgarap 4 Johansen Kaleigh ksjohan 5 Kennedy Dayna dakenn2 6 Leoni James jwleoni 7 Licking Makenna mmlicki 8 Lohmar Jack jclohm1 9 Martinez Alexandro amart64 10 Mennel Michaela mhmenne 11 Miranda Richard rmirand 12 Mozdzen Konrad kcmozdz 13 Pecoraro Andrew ampeco1 14 Sanders Christine crsand2 15 Schmidt Scott sschmi2 Rachel rnunger 16 Unger

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!