« PreviousNext »

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

  1. Consider the array as groups of 5 elements. Find the median of each group.
  2. Use Select recursively to find x, the median of the medians.
  3. Partition the array around x.
  4. Let i denote the number of elements on the low side of the partition. If ni, 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


References

Posted in , , Uncategorized | Trackback | del.icio.us | Top Of Page

No comments yet

Leave a Reply


You must be logged in to post a comment.