Jump to content

Talk:Quickselect: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Returning a range: new section
SineBot (talk | contribs)
m Signing comment by 188.126.200.132 - "Returning a range: new section"
Line 19: Line 19:
== Returning a range ==
== Returning a range ==


A common and natural variant of this algorithm returns a range of values, usually in sorted order. E.g. qselect ([5,2,3,9,0,1,5], 1, 4) would return [1,2,3]. This runs in O(n) + O(k log k).
A common and natural variant of this algorithm returns a range of values, usually in sorted order. E.g. qselect ([5,2,3,9,0,1,5], 1, 4) would return [1,2,3]. This runs in O(n) + O(k log k). <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/188.126.200.132|188.126.200.132]] ([[User talk:188.126.200.132|talk]]) 06:32, 13 August 2014 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->

Revision as of 06:33, 13 August 2014

WikiProject iconComputer science C‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

Overlap with selection algorithm

Some overlap with this and selection algorithm, in particular the section describing this algorithm. Merge out? Dcoetzee 00:04, 18 August 2007 (UTC)[reply]

Precise analysis of the expected time of this algorithm

The expected number of comparisons made by this algorithm, when used (with random pivots) to compute the median, is ; see http://11011110.livejournal.com/119720.html. (Perhaps it would be too much of a conflict of interest for me to add this link myself.) Probably somewhere we should mention the related but more complicated algorithm that finds a sample of about square root of the input size, recurses in the sample, and uses the result as a pivot, getting comparisons in expectation. —David Eppstein (talk) 23:35, 22 August 2013 (UTC)[reply]

Thanks!
Added in this edit.
I’ve also added a brief note about the more complicated algorithm, but it needs elaboration and a reference.
—Nils von Barth (nbarth) (talk) 10:59, 25 August 2013 (UTC)[reply]

I did a bit of digging and found the algorithm you were talking about, which I’ve made a brief article for at Floyd–Rivest algorithm. I plan to expand and incorporate it into selection algorithm by and by.

—Nils von Barth (nbarth) (talk) 13:49, 1 September 2013 (UTC)[reply]

Returning a range

A common and natural variant of this algorithm returns a range of values, usually in sorted order. E.g. qselect ([5,2,3,9,0,1,5], 1, 4) would return [1,2,3]. This runs in O(n) + O(k log k). — Preceding unsigned comment added by 188.126.200.132 (talk) 06:32, 13 August 2014 (UTC)[reply]