Question: Create a generic class for sorting data (numeric and non-numeric). Test data will include integer, float and strings. Numeric data (integer and float) should be

Create a generic class for sorting data (numeric and non-numeric). Test data will include integer, float and strings. Numeric data (integer and float) should be sorted in descending order. Strings should be sorted in lexicographic order (aka dictionary order).

 

The raw data should be stored in an array. For testing, prompt the user to enter 5 data items. You need to prompt the user to enter the type of data (0 – for integer, 1 – for float and 2- for string). After that prompt the user to enter 5 pieces of data.

 

You can use any sorting methods (bubble, selection, insertion or quicksort). However, if you use quicksort, you will earn 5 bonus points.

 

Sorting should be implemented as a method in the generic class. You should have a display method in the generic class to print the data after sorting.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Generic Data Sorter with Quicksort Bonus points Her... View full answer

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 Programming Questions!