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:20
Have a greater impact on maintenance productivity than any other support group. (clo5) a)-the top management b)-inventory and purchasing c)-sub-contracting d)-cmms
Answers: 2
question
Engineering, 04.07.2019 18:20
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
Answers: 2
question
Engineering, 04.07.2019 18:20
A2-m rigid tank initially contains saturated water vapor at 100 kpa. the tank is connected to a supply line through a valve. steam is flowing in the supply line at 600 kpa and 300 c. the valve is opened, and steam is allowed to enter the tank until the pressure in the tank reaches the line pressure, at which point the valve is closed. a thermometer placed in the tank indicates that the temperature at the final state is 200°c. determine (a) the mass of steam that has entered the tank (b) the amount of heat transfer.
Answers: 3
question
Engineering, 04.07.2019 19:20
Heat transfer by is the fastest mode of heat transfer that requires no intervening medium. a)-conduction b)-convection c)-radiation d)-conduction and convection
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
question
Biology, 19.03.2020 06:28
question
Mathematics, 19.03.2020 06:29
question
Business, 19.03.2020 06:29
Questions on the website: 13722361