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, 22.06.2019 00:30
To insert a column without using commands in any tabs, a user can -click and then click insert column.
Answers: 3
question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 22.06.2019 15:30
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
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
Mathematics, 17.03.2020 03:02
question
Social Studies, 17.03.2020 03:03
question
Mathematics, 17.03.2020 03:03
question
Mathematics, 17.03.2020 03:04
Questions on the website: 13722363