Question
please i need your help Assignment: Sorting Algorithms Due Monday, March 27 nd , 2017 Sort Teacher Selection Alley Kenny Bubble Baker, Kyle Insertion Darandri,
please i need your help
Assignment: Sorting Algorithms
Due Monday, March 27nd, 2017
Sort | Teacher |
|
Selection | Alley Kenny |
|
Bubble | Baker, Kyle |
|
Insertion | Darandri, Nebal |
|
Merge | Delperdang, Jeffrey |
|
Quick | Nor, Mustafa |
|
Shell | Poe, Jacob |
|
The purpose of this presentation is to learn about one sorting algorithm how it works, how it performs Big Oh, and explain it to the audience.
You will be using/writing code to test the algorithm in action as Follows:
For a given size N for your input measure the time it takes to get result. For the same N run it at least 5 times present the average-. Lets use int you may try double also- as data type easy to generate with a random generator
What to submit
Characteristics of system used
Hardware | IDE + Any comments |
Example: Processor: Intel Core 2 DUO CPU @ 2.00GHz 2.00GHz. RAM: 2.00GB System Type: 64-bit Operating system | Used Visual studio 2015 Professional edition-. Printing generated numbers from my code to the screen was time consuming. I had to eliminate that to shorten run time |
To avoid the error I got about stack overflow. I could have changed the default setting of It could be done by . |
Results
Note: It will take the computer a while hours may be- as N goes up to finish, be patient !
N | Time (in seconds) |
10,000 |
|
100,000 |
|
1,000,000 |
|
10,000,000 |
|
100,000,000 |
|
1,000,000,000 |
|
See how high you can go |
|
Code Used
#include
void mySort(int array[], int n)// parameters may vary { //Your code will go here }
int main() { const int sizeN = 10000 then 100000 then .; //to hold the data set size int *myArray = new int[sizeN];//Declaring an array of integers with size sizeN. //Populating the array for(int i = 0; i < sizeN ; i++) myArray[i] = rand(); //multiply by 1.35 or some other number for double type clock_t startTime = clock(); // Call you sorting function . Arguments may differ from algorithm to algorithm mySort(myArray, sizeN ); // to compute its execution duration in runtime cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " seconds." << endl; return 0; }
How does the sort work?
In addition to the class presentation, describe in written using an example how your algorithm work. Lets use for that the following numbers
20, 80, 40, 25, 60, 45, 12, 7, 32
Step 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