Content deleted Content added
AdamPark85 (talk | contribs) Rearranged and reworded 3rd paragraph for clarity and consistency with next paragraph Tag: Reverted |
Undo disimprovements. Among other problems, changing "is it" to "it is" loses sight of the fact that this is posed as a question, not an assertion, and "In addition to these conventions" for how to set k to get the max, after setting up a choice of two different conventions that would use different values of k, is flat-out incorrect. |
||
Line 9:
An algorithm for the selection problem takes as input a collection of values, and a {{nowrap|number <math>k</math>.}} It outputs the {{nowrap|<math>k</math>th}} smallest of these values, or, in some versions of the problem, a collection of the <math>k</math> smallest values. For this to be well-defined, it should be possible to [[Sorting|sort]] the values into an order from smallest to largest; for instance, they may be [[Integer (computer science)|integers]], [[floating-point number]]s, or some other kind of object with a numeric key. However, they are not assumed to have been already sorted. Often, selection algorithms are restricted to a comparison-based [[model of computation]], as in [[comparison sort]] algorithms, where the algorithm has access to a comparison operation that can determine the relative ordering of any two values, but may not perform any other kind of arithmetic operations on these values.{{r|cunmun}}
To simplify the problem, some
==Algorithms==
|