Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C++ to do the following: Your program should perform the following: a. Randomly generate three integer arrays A1, A2, and A3

Write a program in C++ to do the following: Your program should perform the following:

a. Randomly generate three integer arrays A1, A2, and A3 of sizes N=103 , 105 , and 107 (or 106 , if your computer cannot handle an integer array of size 107 ), in that order.

b. Run the sorting algorithm QUICK SORT on each of the three arrays A1, A2 and A3, and record the number of comparisons between array elements and actual elapsed times in appropriate time units, for instance, milliseconds.

c. Repeat b on the sorted arrays A1, A2 and A3.

d. Reverse the order of the three arrays A1, A2 and A3 and repeat b once more.

So basically im asking for 3 codes 1 with the ramdom arrays of the specific sizes (1000,10000 and 10000000) another one with the arrays already ordered (increasing 1,2,3,4,....N) and another with the arrays in decreasing order (N...4,3,2,1) for QUICK SORT this is very important because the point of the exercise is to analyze the running times on best, average and worst case for the algorithm.

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_2

Step: 3

blur-text-image_3

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

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions