Jump to content

User talk:TakuyaMurata/Barcelo's method

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by 202.55.159.107 (talk) at 12:11, 20 March 2006 (Use median of first, middle (NOT second) and last elements!). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Carlos' method works, and for *some* inputs results in slightly better running times (note: the following assumes that the pivot value is the median of the first, MIDDLE and last elements, not the first, SECOND and last elements; using first, middle and second results in N*N running time if the input is already in order or in reverse order). Compared to an equivalent method using exchanging, Carlos' method is slightly faster if: - the input is in random order - the input is in REVERSE order But significantly slower if: - the input is already in order (or nearly so).

--james_barbetti@yahoo.com