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, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
Game design colleges anyone know the requirements? ?
Answers: 1
question
Computers and Technology, 25.06.2019 13:40
We are looking at a “sum-scan” (a scan with addition as the operator).sum-scan has two variants. in an “exclusive sum-scan”, the output at each data element isthe sum of all the input elements that came before that element. in an “inclusive sum-scan”,the output at each data element is the sum of all the input elements up to?
Answers: 2
question
Computers and Technology, 25.06.2019 15:00
Most lo/to hazards occur under the following circumstances, except: a) regular operation b) maintenance c) cleaning d) repair
Answers: 2
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
Mathematics, 19.01.2020 05:31
question
Mathematics, 19.01.2020 05:31
question
Mathematics, 19.01.2020 05:31