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 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
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, 25.02.2020 00:01
question
Mathematics, 25.02.2020 00:01
question
Health, 25.02.2020 00:01
question
Mathematics, 25.02.2020 00:01
Questions on the website: 13722361