Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++: Data Structures - Lab 1 Topics covered: Sorting Objective: The objective of this homework is to investigate different sorting algorithms. Task 1: Create

Using C++:

image text in transcribed

Data Structures - Lab 1 Topics covered: Sorting Objective: The objective of this homework is to investigate different sorting algorithms. Task 1: Create a progran that generate an array of sizes n= 10, 100, 500, 5000 and 25000 items. Your program should populate those arrays with randomly generated integers with a value between 0 and the 2n where n is the size of the array. Create an implementation for the following sort operations. a. Bubble sort b. Insertion sort c. Merge-sort d. Quicksort e. Heap-sort f. Counting sort g. Radix-sort Task 2: 1. Test each of the sort operations and record the time the sort takes to complete. You should test each on the same unsorted array to get the best comparison. You should do this for each array size (from task 1) a minimum of 10 times. 2. If any 1 test run takes longer than 5 minutes, you may discontinue that test and record that the time took longer than 5 minutes. Likewise, should any test crash due to running out of memory, record that as well. . Explain how well or poorly it matches your expectations for performance. Include in the lab report a table of performance comparison among various sorting techniques. Data Structures - Lab 1 Topics covered: Sorting Objective: The objective of this homework is to investigate different sorting algorithms. Task 1: Create a progran that generate an array of sizes n= 10, 100, 500, 5000 and 25000 items. Your program should populate those arrays with randomly generated integers with a value between 0 and the 2n where n is the size of the array. Create an implementation for the following sort operations. a. Bubble sort b. Insertion sort c. Merge-sort d. Quicksort e. Heap-sort f. Counting sort g. Radix-sort Task 2: 1. Test each of the sort operations and record the time the sort takes to complete. You should test each on the same unsorted array to get the best comparison. You should do this for each array size (from task 1) a minimum of 10 times. 2. If any 1 test run takes longer than 5 minutes, you may discontinue that test and record that the time took longer than 5 minutes. Likewise, should any test crash due to running out of memory, record that as well. . Explain how well or poorly it matches your expectations for performance. Include in the lab report a table of performance comparison among various sorting techniques

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions