subject
Engineering, 27.12.2019 00:31 anne010p4bffk

In this assignment you are not required to write any sorting function on your own. utilize the functions provided in the header file in the assignment folder. the first part of this assignment will take 2-10 hours depending on your implementation.

in group assignment 2 we examined the bubble sort, selection sort, insertion sort, quick sort, and merge sort functions and compared the time taken for each function to sort 1000- 300,000 random variables. in this assignment we will examine how long these functions (except bubble sort) take to sort 1000 – 150,000 values in increments of 1000 (1000,2000,3000,4000…5). unlike assignment 2 a doubly linked list will be used to store the values however a number of the sorting functions utilize a singly linked list implementation of the algorithm. two versions of the selection sorting algorithm will be used; the data swapping version and the node swapping version of the algorithm. for the other two sorting algorithms a node swapping version will be used.

a header file containing all the required sorting functions (selection sort node, selection sort data swap, insertion sort node, and quick sort node), node structure and node functions has been provided for you.

1. create an integer variable named ‘listsize’ and initialize the value to 1000.

2. open an output file named ‘groupassignment4results. csv’. the first line of this file should be the column headings: ‘list size’, ‘selection sort data swap time’, ‘selection sort node swap time’, ’insertion sort node swap time’, ‘quick sort node swap time’.

3. using the rand () function, fill 4 doubly linked list of integers with the number of variables corresponding to the ‘listsize’ variable. the list should be created using the push operator. the values generated by rand () should be numbers from 1-500,000. the list should be named; selectionlistdata, selectionlistnode, insertionlistnode, and quicklistnode.

4. you should use the: a. selection sort data swap function to sort the selectionlistdata b. selection sort link swap function to sort the selectionlistnode c. insertion sort link swap function to sort the insertionlistnode d. quick sort link swap function to sort the quicklistnode the list size and the time taken to sort each list should be outputted to the previously opened csv file with the time taken for each sorting function placed in the appropriate column.

5. you should then delete all 4 list and increase the size variable by 1000.

6. repeat steps 2-6 until ‘listsize’ is 150,000 (this should be done using a for loop or while loop). 7. utilizing the results from your csv file create line graphs for each function individually and a graph with all the results on a single graph. the size of the list should be placed on the x-axis and the time taken on the y axis.

8. combine the results from your csv file with the results from the group assignment 2 csv file into a single file and create line graphs for each function individually and a graph with all the results on a single graph. the size of the list should be placed on the x-axis and the time taken on the y axis.

the output should be written to a file via file streaming from within the program itself. the unsorted and sorted list should not be written to a file or the screen in your final submission. hand in the source code (header file and main program) and output (csv file) as well as your spss, excel or tableau generated graphs (word document, excel file, or pdf).

data

demo program demonstrating the sorting function. cpp

#include

#include "doublylinkedlist. h"

using namespace std;

int main()

{

int catchvar; //to hold values exiting the queue

//create a dynintqueue object

doublylinkedlist list;

std: : cout < < std: : boolalpha;

list. push(6);

list. push(4);

list. push(6);

list. push(10);

list. push(12);

list. push(31);

list. quicksort();

list. displaylist();

list. removeallnode();

list. displaylist();

list. push(6);

list. push(4);

list. push(6);

list. push(10);

list. push(12);

list. push(31);

list. selectionsortdata();

list. displaylist();

list. removeallnode();

list. displaylist();

list. push(6);

list. push(4);

list. push(6);

list. push(10);

list. push(12);

list. push(31);

list. selectionsortnode();

list. displaylist();

list. removeallnode();

list. displaylist();

list. push(6);

list. push(4);

list. push(6);

list. push(10);

list. push(12);

list. push(31);

list. insertionsortnode();

list. displaylist();

list. removeallnode();

list. displaylist();

return 0;

}

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Air is to be cooled in the evaporator section of a refrigerator by passing it over a bank of 0.8-cm-outer-diameter and 0.4-m-long tubes inside which the refrigerant is evaporating at -20°c. air approaches the tube bank in the normal direction at 0°c and 1 atm with a mean velocity of 4 m/s. the tubes are arranged in-line with longitudinal and transverse pitches of sl- st 1.5 cm. there are 30 rows in the flow direction with 15 tubes in each row. determine (a) the refrigeration capacity of this system and (b) pressure drop across the tube bank. evaluate the air properties at an assumed mean temperature of -5°c and 1 atm. is this a good assumption?
Answers: 1
question
Engineering, 04.07.2019 18:10
Draw the engineering stress-strain curve for (a) bcc; (b) fcc metals and mark important points.
Answers: 1
question
Engineering, 04.07.2019 18:10
An ideal otto cycle with air as the working fluid has a compression ratio of 8. the minimum and maximum temperatures in the cycle are 300 k and 1340 k. use constant specific heats at room temperature to determine (a) the amount of heat transferred to the air during the heat- addition kj/kg, (b) the thermal efficiency, and (c) the thermal efficiency of a carnot cycle ope limits. process, in rating between the same temperature
Answers: 2
question
Engineering, 04.07.2019 18:10
Atmospheric air has a temperature (dry bulb) of 80° f and a wet bulb temperature of 60° f when the barometric pressure is 14.696 psia. determine the specific humidity, grains/lb dry air. a. 11.4 c. 55.8 d. 22.5 b. 44.1
Answers: 1
You know the right answer?
In this assignment you are not required to write any sorting function on your own. utilize the func...
Questions
Questions on the website: 13722363