Content deleted Content added
No edit summary |
|||
Line 22:
The selection problem is to find an item in an unordered list <math>A</math> of size <math>N</math>which is bigger than <math>k-1</math>other elements in <math>A</math>.
{{Collapse|1=
The code makes use of <code>PRAMSORT</code> which is a PRAM optimal sorting algorithm which runs in <math>O(\log N)</math>, and <code>SELECT</code>, which is a cache optimal single-processor selection algorithm.
'''if''' <math>N \leq P</math>'''then'''
<math>\texttt{PRAMSORT}(A,P)</math>
Line 45:
'''end if'''
|2=
Under the assumption that the input is stored in contiguous memory, <code>
<math>O(\frac{N}{PB} + \log PB \cdot \log(\frac{N}{P}))</math><br />
|