Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

xMicrosoft Word-homework2x HackerEarth Hackathons, Inn XMerging An ds/homework3%20(2).pdf COMP 3053: Analysis of Algorithms (Spring 2019) Homework #3 (100 Points) 03/06/2019 Sorting is one of basic

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
xMicrosoft Word-homework2x HackerEarth Hackathons, Inn XMerging An ds/homework3%20(2).pdf COMP 3053: Analysis of Algorithms (Spring 2019) Homework #3 (100 Points) 03/06/2019 Sorting is one of basic algorithms widely used in many applications. In this homework, you need to implement multiple sorting algorithms including: - Merge Sort Quick Sort Selection Sort Insertion Sort A header file is provided for the Sort class: Sort.h. You need to download it from the ecourses, and implement all functions defined in the class using C++ with a file named Sort.cpp. You will also need to create a Main.cpp to create object(s) of the Sort class, and test if these sorting functions are working correctly Submission policy: You need to submit your completed program sourde code to ecourses by at the end of the class time. You need to upload all of your source code: Main.cpp, Sort.cpp, and Sort.h. You need to follow the C++ programming practice to name these files. Do NOT change any of their names or upload other files to ecourses Bonus (20 points): You may use the Vector class you inpleinented in homework #1 as the data structure in this homework. Your code will be able to sort a list with different data types (such as int, char, float). If you do it, you need to submit your Vectorh and Vector.cpp in addition Please note that failure to follow the submission rule will NOT receive credit for the exam i Vhew Project Build Debug Team Tools Test Analyze Window Help Local Windows Debugger You can improve 'Startup performance by disabling "Developer Analytics Tools' extension. Manage Visual Studio Perfo Main.cpp Sort.cpp Sort.h Team Explorer Connect Properties Miscellaneous Files Sort #ifndef SORT-H | #define SORTH 9 10 13 using namespace std; 14 15 class Sort 17 18 public: // Constructors 19 Sort(char "list, int num)i // Default constructor // Destructor *Sort); 21 /I Vector manipulation operations vold selectionsort(); // mplement the selection sort algorithm void insertionsort(); // mplement the selection sort algorith. void MERGESORT) 11 call mergeSort with parameters void QUICKSORT call quicksort with parameters 28 29 // print all items in the dataItems void print) int getsize() const ( return size;) char* getData() const (return dataItems;) // Return the number of items in private: // Data members int size; char "dataltems; 1/ Array containing the vector dsta iten / Actual numben of data item in the vector void mergeSort(char ist, int nu):/ implenent the serge sort algorithn void merge (char .-, int i, char .E, nt N, Char.-,;:// merge A and e te C in asc void quickSort(charlis, nt le, t, int igh);:// implement the quick sort algo int oartition(char "12 int int :Ouick sort aleorithm: partitio 00 % Error List Output AoAHWS- Microsoft Visual Studio File Edit View Project Build Debug Team Tools Test Analyze Window Help Local Windows Debugger You can improve Startup' performance by disabling Developer Analytics Tools extension. Manage Visual Studio Pe Sort (1).h X Sort.cpp" Sort.h Team Explorer Connect Properties (Globat Scope) 6 int main() char myListi[10]-('E','x', A ,'P,E': int len1-7 Sort mySorti(myListi,len1); 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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

4.1 What is job satisfaction?

Answered: 1 week ago

Question

e. What are the programs research and clinical focus areas?

Answered: 1 week ago

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago