Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives: Learn and practice Sorting Algorithms and their Efficiency. Submission: Zipped file Lab 5 _ StudentID.zip, including: Lab 5 . cpp Lab 5 _ report.docx,

Objectives:
Learn and practice Sorting Algorithms and their Efficiency.
Submission:
Zipped file Lab5_StudentID.zip, including:
Lab5.cpp
Lab5_report.docx, including
screenshot(s) of sample runs.
Comments, and references.
Lab Tasks:
Write a C++ function for Quick Sort (You can use the sample code from Moodle or from another resource, mentioning in your report)
Add two counters to the function of Quick Sort, that count the number of comparisons and the number of swaps that are made.
Display the following information:
a. Total counts of comparisons
b. Total counts of swaps
Write a main() function to test a worst, and an average cases in terms of time efficiency.
a. Fill out the array with random numbers for an average case.
b. Fill out the array with selected numbers for the worst case.
c. Make sure to test with more than 10 numbers, too little data set would not see significance.
image text in transcribed

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions