Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Selection Sort with data type Thanks In this project you are going to implement one of the sorting algorithms below which your student group is

image text in transcribedimage text in transcribedSelection Sort with data type

Thanks

In this project you are going to implement one of the sorting algorithms below which your student group is responsible for. MySort.h class MySort { private: int* data; /* you need to change the data type (double or char instead of int) T L depending on the sorting algorithm you are responsible/ L const int N = 100; /* N should be adjustable (when we change N to i.e: 10000 L than your algorithm can sort 10000 values) */ You need to implement a full sorting class (depending on the algorithm your group is responsible assigned in the page below) with both ascending and descending sorting operations along with random assignment functions. You need to use the following header file named as "Mysort.h". Include it in your project and design your data types depending on the requirements of your own sorting algorithm. You need to create a cpp file named as "Mysort.cpp" and define the functions whose declarations are already given in the "Mysort.h" header file. You need to design sortAscending and sortDescending functions with the specific sorting algorithm that your student group is responsible. You need to submit all 3 files "SortTest.cpp" (sample test file including main), "Mysort.h", "MySort.cpp", in a zip file by the deadline of the homework. public: MySort(); void assignRandom(); /* assigns random values into the data' array void printData(); /* prints out the data' array void printArray(int*); /* prints out the array passed as parameter i int* sortAscending(); /* sorts out the data' array in ascending order and outputs sorted array */ int* sortDescending(); /* sorts out the data' array in descending order I L and outputs sorted array */ T Sample test code #include "MySort.cpp" #include using namespace std; Sample output int main(void) { Random Numbers My Sort sorter; int* sortedValues; 120, 60, 10, 620, 650, 340, 93e, 238, 7ee, 2e, 620, 760, 230, 920, 910, 640, 470, 680, 480, 840, se, 770, 150, 380, 330, 250, 220, 170, 510, 760, 660, 970, 870, 930, 370, 930, 580, 748, 690, 330, 820, 930, 800, 280, 930, 87, 670, 670, 270, 720, 7e, gee, 440, 390, 320, 350, 820, 30, 8ee, 248, 410, 140, 920, 370, 890, 610, 930, 390, 72e, 290, 620, 712, 7e, 52 2, 720, 620, S60, 460, 940, 480, 300, 140, 500, 670, 330, 680, 390, 570, 890, 650, 610, 60, 450, 770, 540, 190, 860, 718 170, 85e, Ascending Numbers cout

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

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

What is the meaning and definition of E-Business?

Answered: 1 week ago

Question

Discuss consumer-driven health plans.

Answered: 1 week ago