BFPRT. they find they
14 August 2008
In computer science, BFPRT (Blum, Floyd, Pratt, Rivest, Tarjan) is a four step algorithm to select the nth smallest element of an array.
Contents |
Algorithm
- Consider the array as groups of 5 elements. Find the median of each group.
- Use Select recursively to find x, the median of the medians.
- Partition the array around x.
- Let i denote the number of elements on the low side of the partition. If n ≤ i, use Select recursively to find the nth element of the low side. Otherwise return the n-ith element of the high side.
Implementation
See also
- Quickselect
- Selection algorithm (Much more detail here.)
References
No comments yet
Leave a Reply
You must be logged in to post a comment.