Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives: There are many times, as a programmer, you will encounter a scenario where you need to sort a data structure. After completing this assignment

Objectives: There are many times, as a programmer, you will encounter a scenario where you need to sort a data structure. After completing this assignment students will be able to:
Implement Bubble Sort
Implement Insertion Sort
Implement Merge Sort
Task Description: You have been given a text file (roster.txt) filled with students' information (Name, Birthdate, and grade in the class). You are tasked with sorting the students with three sorting algorithms (insertion, bubble, and merge sort). Using Insertion Sort, you should sort the students by birth date. Using Bubble Sort, you should sort the students by name. Using Merge Sort, you should sort the students by Grade.
When running each sorting algorithm, keep track of the time it takes. You can use the method System. nanoTime (), which will return a time stamp. Print the run time of each into the console.
What your program should do:
Sort in three different ways
Print the sorted list
Print the running time of each sorting algorithm
You must implement insertion sort, bubble sort, and merge sort yourself.
image text in transcribed

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions