Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC421 Assignment 4 (50 Points) Student Name: Student ID: Complete the following program named my Quicksort epp to sort and display a random integer array.

image text in transcribed
CSC421 Assignment 4 (50 Points) Student Name: Student ID: Complete the following program named my Quicksort epp to sort and display a random integer array. You need to compile and run your program using the con c++ -o myQuicksort myQuicksort.cpp center myQuicksort n center Where 0-n is the number of random integers in the integer array. myQuicksort.cpp #include #include # include # include using namespace std // array class "! pointer to body /l size of body // quick sort class myArray ( int ptr int size, void quickSort(int, int, int) public myArray(int) -myArray0(free(ptr):) void sortOfquick Sort(ptr, 0, size-):) void display(int) /f constructor // destructor l/ sort elements /l display elements void myArray:quickSont(int al], int I, int n)0 // to be implemented myArray:myArray(int s)( I/ constructor ptr- (int *) malloc(s sizeof(int)) size s srand(unsigned) time(NULL); for int i-O, iksize, i++) Il set random seed // 0sptrlils255 /l display, m elements per line ptr(i)-rand()%256; void myArray: display(int m) coutsc" Array Elements:"endl

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_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago