Talk:Selection sort

message: As quicksort and insertion sort before it, this article is accumulating an excessive number of conceptually identical implementations. I will deal with this in the same way, by creating a separate article for implementations, and sharing a template between that article and this one giving a small number of conceptually different representative implementations. Deco 08:59, 11 December 2005 (UTC)
replies: text: I've completed this. Please add Template:Selection sort core implementations to your watchlist, as this template is now transcluded in this article. I also added an Ocaml implementation, because the functional version is significantly different (and Ocaml seems to be the most popular functional language among mainstream programmers nowadays). Deco 10:26, 11 December 2005 (UTC)
thread_title:  Excessive implementations 

message: Can anyone make a diagram of this algorithm? --EvaGears 03:03, 6 January 2007 (UTC)
replies: text: Great idea. It might be instructive to use the "card sorting" metaphor, since cards are often sorted using this algorithm or insertion sort. It also just occurred to me that we don't discussion selection sort on linked lists. Dcoetzee 22:37, 10 June 2007 (UTC)

text: I made an animated diagram and added it.  I hope it's sufficient; I tried to just keep it simple.--Joestape89 (talk) 10:53, 5 December 2007 (UTC)

text: Please consider static diagrams! http://corte.si/posts/code/visualisingsorting/index.html 84.182.107.93 (talk) 16:56, 9 February 2010 (UTC)
thread_title:  Diagram? 

message: By using the bubble sort with 2 imbricated for loops and reversing the second one, we obtain a bubble sort that is faster than selection sort for the worst cases and much faster than the original version of bubble sort. Tests so far have proven this without a doubt. This should become the new bubble sort. Fix these lies wikipedia!
L337 Krew (talk) 13:51, 13 February 2008 (UTC)
replies: text: You've modified the sort so that it's no longer bubble sort, which is original research, and your measurements are architecture-specific. There is no reason to modify the articles. Also, please don't post in multiple places - see Wikipedia:Talk page guidelines#multi. Dcoetzee 20:05, 13 February 2008 (UTC)
thread_title: Lie: Selection sort outperforms bubble sort

message: Does bingo sort merit its own stubby article or should it stay here? MahangaTalk 07:22, 21 February 2008 (UTC)
thread_title: bingo sort

message: Hi all. A while ago I began an experiment with a new method for discouraging incorrect good-faith changes to code and pseudocode called "code block templates" on the articles quicksort and binary search algorithm. So far there haven't been any incorrect new changes to those code block templates, but very few changes have been made, so I'd like to expand the scope of this experiment to see how effective it is. This is one of the articles I'm targeting for this second phase. Please let me know on my talk page if you have any questions or concerns. Thanks! Dcoetzee 21:36, 7 December 2008 (UTC)
thread_title: Code block templates

message: The article has the external link
*http://www.sorting-algorithms.com/selection-sort
When I was trimming the ELs down, I left it in because it had a Discussion section and some references. I was indifferent on the animation.
That EL is now involved in a minor editor war. One editor restored with the statement that the link contains useful information that is not in the article. I've taken a closer look at the EL, and here's what I see.
# There is a list of properties that are similar to the WP info box. The only property not mentioned in the article is "Not adaptive".
# There is a discussion section. It notes that SS is not adapative and hence is always quadratic time. That info is implied in the article's infobox. It makes a second observation that SS minimizes the number of swaps. The WP article states that SS uses O(n) swaps compared to insertion sorts O(n2). WP goes on to say cycle sort is better. 
# There is a list of references, but the only explicit ref on selection sort is a youtube video of a Gypsy folkdance. IIRC, that EL made it into this article and was removed.
# The parallel animation shows the operation of four data sets. The animation runs in "lockstep" for SS. The animation would be good for other sorting algorithms that are "adaptive".
*Remove the link. The link could be good for other sorting algorithms, but the current WP article has the information in the link. Glrx (talk) 16:41, 5 August 2011 (UTC)
thread_title:  Sorting-algorithms.com external link 

message: I found a variant that does not search the minimum element, but swaps whenever an item is found that is less than the one at the current index. Sometimes this, sometimes the given variant is refered to as "straight select(ion) sort". I think, this variant (wich also has some parallels to bubble sort) should be mentioned, here, as well.
A German page names this variant "Ripple Sort" (http://www.tinohempel.de/info/info/ti/ripplesort.htm) - whilest BiDiBubble Sort also is known under "Ripple Sort" (German Wikipedia).  — Preceding unsigned comment added by 217.191.2.245 (talk) 20:02, 8 February 2015 (UTC)
thread_title:  Straight selection sort 

message: I deleted the "Mathematical definition" section, since it was just plain wrong. It confused the concepts of set, multiset and sequence, resulting in nonsense. A set is a fundamentally unordered object so a sorting routine cannot be defined as inputting and outputting a set. It makes no sense to say "remove one instance of some element from a set" because sets have no multiplicities. Dricherby (talk) 21:17, 3 March 2015 (UTC)
thread_title:  "Mathematical definition" 

message: The section about the cocktail selection sort says that it is « not actually decreasing the number of comparisons or swaps », but this isn't true: finding the min element of a list of size n takes n-1 comparisons; finding the max element also takes n-1 comparison. However, finding both in one pass (like std::minmax_element in C++) only takes \frac{3}{2}(n-1) comparisons instead of 2(n-1) for the naive method. Provided a cocktail selection sort uses such an algorithm, it effectively performs less comparisons than a simple selection sort. 92.135.21.237 (talk) 21:33, 15 October 2015 (UTC)
thread_title:  Cocktail selection sort performs less comparisons 

message: to "Selection sorting"
(and other pages - also)  — Preceding unsigned comment added by 130.180.212.50 (talk) 09:41, 11 March 2017 (UTC)
replies: text: The term "selection sort" is treated as a noun phrase -- it is essentially the name of this sorting algorithm. Perhaps that should be clarified in some way? Perhaps only on sorting algorithm though. nhinchey (talk) 08:16, 22 May 2019 (UTC)
thread_title:  Plz rename page 

message: I am familiar with O() notation, but I've never seen it with Θ before. Can someone please elucidate that?
:(Foreword: this is not really the place for this question, but I'll answer it anyway.) As you know, O() is an upper bound description of growth.  If growth can be described linearly, then it can be described as O(n) because there is a linear function that can provide an upper bound.  But isn't O(n!) also an upper bound?  Likewise, a function with linear growth can be described with a lower bounding function Ω(n), but isn't Ω(1) also a lower bound?  We do not always know the lower and upper bounds, but when we do and when they are the same, we can describe them with theta.  If an algorithm has growth described by O(n) and Ω(n), then it is also Θ(n). This is the most concise and accurate description of growth.  I would like to reiterate that we do not always know the smallest O() of a function or the largest Ω(n).  There are computer scientists who dedicate their research to this, and, for instance, it was only proved in March 2019 that multiplication can be performed in O(n log n) time, but even that (massively complicated) paper left many questions unanswered about the nature of something so "simple" as multiplication!  For more about Θ(), check out this subsection of Big O Notation: Related Asymptotic Notations.Wurtech (talk) 17:36, 23 May 2019 (UTC)
replies: text: Edit: It occurred to me that you probably meant elucidate it in the article.  I'll consider that, but Θ() is a basic idea so I think it is best to link to the Big O Notation article as I did above.Wurtech (talk) 17:36, 23 May 2019 (UTC)
thread_title:  What's with all the Θs (thetas)? 

message: Selection sort does not always have the minimum number of swaps. For example, with [7, 1, 3, 4, 5], it will swap the 7 four times. Cycle sort requires zero swaps, as it will take [7, 1, 3, 4, 5] and rotate it to [1, 3, 4, 5, 7] by using a single temporary variable rather than swaps. The importance of this is that it may be expensive in some way to write to the list to be sorted, and writing each element exactly once to its final place is cheaper than writing the 7 four times and the others one time each. Chai T. Rex (talk) 07:14, 9 November 2022 (UTC)
thread_title:  Selection sort does not have the minimum number of swaps