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, 22.06.2019 18:10
How can i delete permalinks from a word press site?
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Font size, font style, and are all aspects of character formatting.
Answers: 2
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, 20.09.2020 06:01
question
Advanced Placement (AP), 20.09.2020 06:01
question
Chemistry, 20.09.2020 06:01
question
Spanish, 20.09.2020 06:01
Questions on the website: 13722360