subject

The kth quantiles of an n-element set are the − 1 order statistics that divide the sorted set into k equal-sized sets (to within 1). Give an ( log ) time algorithm to list the kth quantiles of a set.
1. If k=1 we return an empty list.
2. If k is even, we find the median, partition around it, solve two similar subproblems of size ⌊n/2⌋ and return their solutions plus the median.
3. If k is odd, we find the ⌊k/2⌋ and ⌈k/2⌉ boundaries and then we reduce to two subproblems, each with size less than n/2. The worst-case recurrence is:
T(n, k) = 2T(⌊n/2⌋,k/2)+O(n)
Which is the desired bound ­ O(nlgk).
This works easily when the number of elements is ak+k−1 for a positive integer a. When they are a different number, some care with rounding needs to be taken in order to avoid creating two segments that differ by more than 1.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
Type the correct answer in the box. spell all words correctly.what kind of graph or chart does this image represent? the given image represents a (blank).
Answers: 2
question
Computers and Technology, 22.06.2019 16:50
Consider a slotted aloha system, where the time slot equals the fixed duration of each packet. assume that there are 4 stations a,b,c,d sharing the medium. (a) stations a,b,c,d receive one packet each from higher layers at times 1.3, 1.5, 2.6,5.7 respectively. show which transmissions take place when, according to the slottedaloha protocol; describe all transmissions until all four packets have been successful.when needed, each station has access to the following sequence of random number, provided by a random number generator and drawn uniformly between 0 and 1: (1) station a draws numbers: 0.31, 0.27, 0.78, 0.9, 0.9, 0.11, 0. (2) station b draws numbers: 0.45, 0.28, 0.11, 0.83, 0.37, 0.22, 0. (3)station c draws numbers: 0.1, 0.2, 0.3, 0.4, 0. (4) station d draws numbers: 0.36, 0.77, 0.9, 0.1, 0.1, 0.1, 0.1, 0. (b) in slotted aloha, a station transmits in each time slot with a given probability. what probabilities would you assign to each of the four stations so as to: (i) maximize the efficiency of the protocol? (ii) maximize fairness among the four stations? (c) will the efficiency increase or decrease if we modify slotted aloha as follows: (i) get rid of slots and allow stations to transmit immediately? (ii) implement carrier sensing? (iii) implement collision detection? (iv) implement collision avoidance?
Answers: 3
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
You know the right answer?
The kth quantiles of an n-element set are the − 1 order statistics that divide the sorted set into...
Questions
question
Physics, 03.09.2021 20:00
question
Computers and Technology, 03.09.2021 20:00
question
Mathematics, 03.09.2021 20:10
Questions on the website: 13722360