Question: Write a program that implements a Counting Sort that will sort an array of integers. Research how Counting Sort works before you implement it. We

Write a program that implements a Counting Sort that will sort an array of integers. Research how Counting Sort works before you implement it.

We have the following list of numbers that are unordered: 90, 80, 30, 60, 50, 40, 70, 80, 40, 30, 60, 50, 70

Write a program that will arrange these numbers in ascending order.

You will first work through how you will begin the program by answering the following questions:

What is the main difference between Counting Sort and other sorting algorithms such as Selection Sort, Bubble Sort, and Insertion Sort?

In what situations would Counting Sort be efficient or inefficient to sort an array of integers?

What will your input line look like?

What will your output look like once you run the program?

You will need to include your input line and use the rest of the details from the output below to build your code. Please remember that: int k = 90

Your final output should read as follows: run: Counting sort in Java integer array before sorting [90, 80, 30, 60, 50, 40, 70, 80, 40, 30, 60, 50, 70] integer array after sorting using counting sort algorithm [30, 30, 40, 40, 50, 50, 60, 60, 70, 70, 80, 80, 90]

Also, ensure that the following requirements are met:

Java files are named correctly.

Name, date and assignment information is included at the top of your Java code files as a comment.

Java code is properly indented and readable.

Code comments are present within each major section of code.

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!