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, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 13:50
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
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, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
question
Mathematics, 12.07.2021 14:00
Questions on the website: 13722361