subject

The kth quantiles of an n-element set a are the k − 1 order statistics that divide the sorted set into k equal-sized sets (to within 1). that is, the kth quantiles are select(a, n/k), select(a, 2n/k), …, select(a, (k − 1)n/k) (here we are assuming that k divides n). finding the kth quantiles directly in this way would take o(nk) time. given an unsorted array a of n distinct keys and an integer k, with 1 ≤ k ≤ n, give an o(n log k) algorithm to find the kth quantiles of a. you may assume that k divides n. you may assume that the linear-time (deterministic) select algorithm (page 220) is available as a subroutine.1. describe your algorithm in pseudocode. comment your code.2. prove that your algorithm is correct, i. e., argue that it returns the kth quantiles of a. use induction.3. analyze the running time of your algorithm, i. e., explain carefully why your code runs in o(n log k) time.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:00, fastpitchhailey1354
Write a loop that prints each country's population in country_pop. sample output for the given program with input 'china: 1365830000,india: 1247220000,united states: 318463000,indonesia: 252164800': united states has 318463000 people. india has 1247220000 people. indonesia has 252164800 people. china has 1365830000 people.
Answers: 2
image
Computers and Technology, 21.06.2019 21:30, willwhitlock803
Write code using c . (take input from user) calculate the size of a given file in kbs. in this task you will complete the function with the following prototype: float get_file_size(char * filename); the function takes the file name (address to the start of a null terminated character array) as input. the function should then open the file and find the number of bytes it contains till eof. the number of bytes divided by 1024 will give the size in kbs. if the file cannot be opened the function should return -1.
Answers: 2
image
Computers and Technology, 22.06.2019 22:20, gingerham1
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
image
Computers and Technology, 23.06.2019 07:30, Braxtonw875
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
You know the right answer?
The kth quantiles of an n-element set a are the k − 1 order statistics that divide the sorted set in...

Questions in other subjects:

Konu
Mathematics, 07.10.2020 06:01
Konu
Mathematics, 07.10.2020 06:01
Konu
Mathematics, 07.10.2020 06:01
Konu
Mathematics, 07.10.2020 06:01