subject
Computers and Technology, 22.07.2021 21:30 j015

In this lab you will need to write a c program and an excel file. You will need to submit both your code and the excel file in the webcourses. Experimental Study of the Execution Times of the Sorting Algorithms
In this lab, you will perform experimental studies on the sorting algorithms we have learned so far. You are asked to compare the execution times of the following sorting algorithms:selection sort, bubble sort, insertion sort, merge sort, and quicksort All of these algorithm source codes in c are available in your main course webcourses. So, copy them as you need. In order to do the comparison, you will need to:
1) Create 6 arrays of different sizes. The sizes of the arrays will increase with a fixed length.
2) For each array, fill it with random numbers using random number generator.
3) Pass this array to each sorting algorithm (copy the original array before passing it to the sortingalgorithm as the sorting algorithm will change your array).
Write down the execution time for each algorithm in an excel file and plot them to see how the execution time changes with time.
A good idea could be creating an array containing the total number of data you want to produce at each phase. For example, A sizes array with total number of elements for each test cases [1000, 10000, 20000, 40000, 50000, 100000] can be useful to generate 1000 number, 10K number, and so on. You may find the following hints useful:
1) To generate random numbers between [1, maxVal] you can use the rand function:
n = r and ()% maxVal + 1; Just put this line in your for loop and store n in the array.
2) To calculate the execution time you can use the following technique:
int start = time(0);
bubbleSort(sortedArray, sizes[i]);
int end = time(0);
printf("Sorting %d values took %d seconds for Bubble sort.\
n", sizes[i], end
-start);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 24.06.2019 03:40
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i.e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Which computer tools allow you to communicate with coworkers, family,and friends
Answers: 1
You know the right answer?
In this lab you will need to write a c program and an excel file. You will need to submit both your...
Questions
question
Mathematics, 04.06.2021 05:30
question
Computers and Technology, 04.06.2021 05:30
question
Mathematics, 04.06.2021 05:30
question
Mathematics, 04.06.2021 05:30
question
Chemistry, 04.06.2021 05:30
Questions on the website: 13722367