Login to Your Account

Solution Posted by

- Requests: 0
- Solutions: 262

Solution Detail

Price: $20.00

- From: Computer Science, Programming
- Posted on: Wed 16 Apr, 2014
- Request id: None
- Purchased: 0 time(s)
- Average Rating: No rating

Request Description

VS2010 C++ Sorting Algorithm Comparison Bubble, Quick, Heap, Selection Sort

Purpose

This program will provide an opportunity to use and analyze various sorting algorithms.

Specifications

Write a program to compare the relative performance of different sorting algorithms on three datasets containing the integers 1..100. Ultimately, the data should be sorted in ascending order. The three input datasets are respectively sorted:

•Inverse.txt (in opposite order - descending)

•Random.txt (randomly)

•Almost.txt (almost in order - ascending)

You should include the following sorting algorithms in your analysis. Feel free to place all of these in the same file. This is an analysis problem, not a structured software solution.

•Selection Sort

•Bubble Sort

•Bubble Sort2 (with sort completion flag)

•Heap Sort Files

•Heap Sort Example

•QuickSort

To measure the performance of the various sorting routines, count the number of comparisons and swaps required to achieve the desired ascending sorted order. You will be required to perform this analysis for all sorting routines for all three datasets. Be sure to measure compares as occurrences in each algorithm where array elements themselves are compared. Some algorithms compare counters as part of the algorithm. These should not be included in the count of compares.

You should utilize global variables as counters. This is required for the recursive algorithms. Place all functions in one file, if necessary. For counting the comparisons, consider each place in each algorithm where an expression exists such as: if (array[] > array[]) where an array element is compared to another. Swaps in the algorithms utilize an included function swap(). Be sure to utilize two separate counters; one for total swaps and one for total comparisons.

USE COMMENTS!!

Deliverables

Upload the following as your final product:

•All final source code files (.cpp and/or .h files)

•Printed output using the provided input files.

•A summary table that describes the results of the experiment along with a summary statement (paragraph or so) highlighting your conclusions from the results.

Solution Description

Attachments