subject

1. Using C++. Implement merge sort and insertion sort programs to sort an array/vector of integers. You may implement the algorithms in C++ language, name one program "mergesort" and the other "insertsort". Your programs should be able to read inputs from a file called "data. txt" where the first value of each line is the number of integers that need to be sorted, followed by the integers. Example values for data. txt:4 19 2 5 118 1 2 3 4 5 6 1 2The output will be written to files called "merge. out" and "insert. out".For the above example the output would be:2 5 11 191 1 2 2 3 4 5 62. The goal of this problem is to compare the experimental running times of the two sorting algorithms. A) Modify code- Now that you have verified that your code runs correctly using the data. txt input file, you can modify the code to collect running time data. Instead of reading arrays from the file data. txt and sorting, you will now generate arrays of size n containing random integer values from 0 to 10,000 to sort and then time how long it takes to sort the arrays. We will not be executing the code that generates the running time data so it does not have to be submitted to TEACH or even execute on flip. Include a "text" copy of the modified code in the written HW submitted in Canvas. B) Use the system clock to record the running times of each algorithm for n = 1000, 2000, 5000, 10,000, …. You may need to modify the values of n if an algorithm runs too fast or too slow to collect the running time data. If you program in C your algorithm will run faster than if you use python. You will need at least seven values of t (time) greater than 0. If there is variability in the times between runs of the same algorithm you may want to take the average time of several runs for each value of n. C) For each algorithm plot the running time data you collected on an individual graph with n on the x-axis and time on the y-axis. You may use Excel, Matlab, R or any other software. Also plot the data from both algorithms together on a combined graph. Which graphs represent the data best?D) What type of curve best fits each data set? Again you can use Excel, Matlab, any software or a graphing calculator to calculate a regression equation. Give the equation of the curve that best "fits" the data and draw that curve on the graphs of created in part c).E) How do your experimental running times compare to the theoretical running times of the algorithms? Remember, the experimental running times were "average case" since the input arrays contained random integers.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:40
Hello my name is mihai and i need your : )i have to do a python project in computer science and i’m really busy with my mocks this period of time besides this i’m not good at coding so could someone pls pls pls sort me out ? i actually beg ; ))
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
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, 24.06.2019 15:20
Local area networks use many of the same network technologies and the internet, only on a smaller scale. devices that access lans are equipped with a network interface that contains circuitry for wireless or wired connections. devices also have a physical address, in addition to the ip addresses acquired from a dhcp server. the most popular wired technology is . the most popular wireless technology is , which can be configured as a(n) or star topology. setting up a lan and configuring its router is fairly easy. the first step is to change the standard to one that is secure. next, create a(n) that uniquely identifies the network by name. it is also important to activate wireless to prevent wireless signals from being intercepted during transmission. a limited-access network can be created for visitors to use. by activating , the router will be able to assign ip addresses to each device that joins the network. to connect to a secure lan that is protected by encryption, an encryption , or password, is required. lans can be used to access data collected by iot devices and the networks that tie these devices together. technologies such as rfid, nfc, bluetooth smart, zigbee, and z-wave offer -power links, essential for battery-powered devices that can’t expend excess amounts of energy transmitting data.
Answers: 1
You know the right answer?
1. Using C++. Implement merge sort and insertion sort programs to sort an array/vector of integers....
Questions
question
Mathematics, 18.12.2020 23:40
question
Mathematics, 18.12.2020 23:40
question
Mathematics, 18.12.2020 23:40
question
English, 18.12.2020 23:40
question
English, 18.12.2020 23:40
question
Mathematics, 18.12.2020 23:40
Questions on the website: 13722367