Question
The problem down below needs to be executed using a C++ coding language on Visual Data Studio 2015. The problem is separated into different parts
The problem down below needs to be executed using a C++ coding language on Visual Data Studio 2015. The problem is separated into different parts but it still falls under the same questions. Therefore, there is no need to post it separately. The five different types of sorting need to be implemented when created the code, that of which includes: selection, insertion, shell, quick- and merge sort. In regards to the running time, try to distinguish it in micro or nano seconds as seconds alone will not work when dealing with this problem. The rest of the questions are self explanatory and need to be answered as well. Include numerous comments throughout the code and make sure there are no errors. I will rate afterwards accordingly.
Answer all parts! Need code done ASAP! Thank you.
In this project you will write a program that compares the actual performance, with respect to actual running times and numbers of comparisons performed, of the five comparison-based sorting algorithms you learned in class. Specifically, you need to complete the following steps: 1. (100 pts) Implement the five comparison sorts (selection, insertion, Shell, quick-and merge sorts) given in class according to their pseudocode provided in the zyBook, and include them in one Java/C++ class. For Shell sort, use the gap values 2-1, 2-1-1, ..., 3, 1, where k = [log nj and n is the length of the input array. 2. (50 pts) Write code in your "main" function that performs the following: a) For each ne {10, 5x103, 104, 5x104, 105}, randomly generate 5 integer arrays of length n. b) Run each of the five comparison sorts you implemented in Step 1 on all the five arrays generated in Step 2.a and record the worst-case actual running time and number of comparisons performed among elements in the input array. 3. (20 pts) Save the results from 2(b) in one or two tables and include them in your project report. 4. (30 pts) Discuss the following in your project report based on your results from Step 3: a) Do the numbers of comparisons performed reasonably reflect the overall running times of the corresponding algorithm? If not, what are the possible reasons. Does the size of the input array have any significant effect? b) is the performance of the studied algorithms with respect to actual running time and number of comparisons performed consistent with their theoretical time complexity? If not, what are the possible reasons? In this project you will write a program that compares the actual performance, with respect to actual running times and numbers of comparisons performed, of the five comparison-based sorting algorithms you learned in class. Specifically, you need to complete the following steps: 1. (100 pts) Implement the five comparison sorts (selection, insertion, Shell, quick-and merge sorts) given in class according to their pseudocode provided in the zyBook, and include them in one Java/C++ class. For Shell sort, use the gap values 2-1, 2-1-1, ..., 3, 1, where k = [log nj and n is the length of the input array. 2. (50 pts) Write code in your "main" function that performs the following: a) For each ne {10, 5x103, 104, 5x104, 105}, randomly generate 5 integer arrays of length n. b) Run each of the five comparison sorts you implemented in Step 1 on all the five arrays generated in Step 2.a and record the worst-case actual running time and number of comparisons performed among elements in the input array. 3. (20 pts) Save the results from 2(b) in one or two tables and include them in your project report. 4. (30 pts) Discuss the following in your project report based on your results from Step 3: a) Do the numbers of comparisons performed reasonably reflect the overall running times of the corresponding algorithm? If not, what are the possible reasons. Does the size of the input array have any significant effect? b) is the performance of the studied algorithms with respect to actual running time and number of comparisons performed consistent with their theoretical time complexity? If not, what are the possible reasonsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started