Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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 reasons

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

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

Students also viewed these Databases questions