Talk:Quickselect algorithm

From Rosetta Code
Revision as of 01:23, 1 October 2013 by rosettacode>Spoon! (→‎How is pivot chosen?: new section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How is pivot chosen?

Should the task specify how the pivot is to be chosen? Or should it leave it up to the implementer (and perhaps specify explicitly that the implementer can choose it how they want)? For example, the Python implementation chooses a random pivot, so it is randomized quickselect. There are other ones, e.g. choose the first element, or median of three, etc. --Spoon! (talk) 01:23, 1 October 2013 (UTC)