subject

Sort an array of 10,000 elements using the quick sort algorithm as follows: a. sort the array using pivot as the middle element of the array. b. sort the array using pivot as the median of the first, last, and middle elements of the array. c. sort the array using pivot as the middle element of the array. how- ever, when the size of any sublist reduces to less than 20, sort the sublist using an insertion sort. d. sort the array using pivot as the median of the first, last, and middle elements of the array. when the size of any sublist reduces to less than 20, sort the sublist using an insertion sort. e. calculate and print the cpu time for each of the preceding four steps. to find the current cpu time, declare a variable, say, x, of type clock_t. the statement x = clock(); stores the current cpu time in x. you can check the cpu time before and after a particular phase of a program. then, to find the cpu time for that particular phase of the program, subtract the before time from the after time. moreover, you must include the header file ctime to use the data type clock_t and the function clock. use a random number generator to initially fill the array.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 14:00
When creating a field in a table, you must set the to determine what type of data the field can store. field property data type field type data property
Answers: 1
question
Computers and Technology, 24.06.2019 21:00
How does a vaccine prevent sickness and individual?
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
Write an algorithm to check if a number is even or odd and show with flow chart step by step
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
Jenny wants to create an animated short video to add to her website. which software will she use to create this animated video?
Answers: 1
You know the right answer?
Sort an array of 10,000 elements using the quick sort algorithm as follows: a. sort the array using...
Questions
question
Mathematics, 24.06.2019 06:30
Questions on the website: 13722363