Talk:Quicksort: Difference between revisions
m Removed deprecated parameters in {{Talk header}} that are now handled automatically (Task 30) |
|||
(9 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{Talk header |
{{Talk header}} |
||
{{ |
{{WikiProject banner shell|class=B|vital=yes|1= |
||
{{WikiProject |
{{WikiProject Computing|importance=top}} |
||
{{WikiProject |
{{WikiProject Computer science|importance=top}} |
||
{{WikiProject Computer science|class=B|importance=top}} |
|||
{{WikiProject Mathematics|class= |
|||
⚫ | |||
}} |
}} |
||
{{archive box| auto=long | |
{{archive box| auto=long | |
||
Line 19: | Line 15: | ||
|algo = old(120d) |
|algo = old(120d) |
||
|archive = Talk:Quicksort/Archive %(counter)d |
|archive = Talk:Quicksort/Archive %(counter)d |
||
⚫ | |||
{{Broken anchors|links= |
|||
* <nowiki>{{Section link||Analysis of randomized quicksort}}</nowiki> The anchor (,,) is no longer available because it was [[Special:Diff/704104957,|deleted by a user]] before. <!-- {"title":"Analysis of randomized quicksort","appear":{"revid":594480580,"parentid":591700405,"timestamp":"2014-02-08T06:58:42Z","replaced_anchors":{"Analysis of Randomized quicksort":"Analysis of randomized quicksort"},"removed_section_titles":["Analysis of Randomized quicksort"],"added_section_titles":["Analysis of randomized quicksort"]},"disappear":{"revid":704104957,"parentid":703118144,"timestamp":"2016-02-09T15:52:25Z","removed_section_titles":["Average-case analysis using discrete probability","Average-case analysis using recurrences","Analysis of randomized quicksort"],"added_section_titles":["Worst-case analysis","Best-case analysis","Average-case analysis","Using percentiles","Using recurrences","Using a binary search tree"]}} --> |
|||
}} |
}} |
||
== Blog interview == |
== Blog interview == |
||
Line 34: | Line 33: | ||
<!-- Template:Unsigned --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Geke|Geke]] ([[User talk:Geke#top|talk]] • [[Special:Contributions/Geke|contribs]]) 25 August 2020 (UTC)</small> |
<!-- Template:Unsigned --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Geke|Geke]] ([[User talk:Geke#top|talk]] • [[Special:Contributions/Geke|contribs]]) 25 August 2020 (UTC)</small> |
||
== Finding pivot - ERROR == |
|||
There is a an error in finding the mid-point for the pivot. |
|||
<code>pivot := A[ floor((hi + lo) / 2) ] // The value in the middle of the array</code> |
|||
This is a problem for large values of hi and/or lo. The hi+lo part may overflow the integer type of hi/lo - so you would get a false value. |
|||
This should be: |
|||
<code>pivot := A[ floor((hi - lo)/2) + lo ] // The value in the middle of the array</code> |
|||
This gives the same result, with no risk of overflowing. |
|||
Please update - the former code should not be used. [[Special:Contributions/89.134.22.144|89.134.22.144]] ([[User talk:89.134.22.144|talk]]) 10:21, 22 November 2022 (UTC) |
|||
== Adding a Tradeoffs section == |
|||
Hello, I am thinking about adding a Tradeoffs section to this article to discuss some of the disadvantages of Quicksort. Some of the topics I am thinking about discussing is its lack stability, and what situations where its performance can degrade to O(n^2), and a few other topics. [[User:KaiXuanWen|KaiXuanWen]] ([[User talk:KaiXuanWen|talk]]) 20:22, 12 March 2023 (UTC) |
|||
== More examples of Quick Sort in practice == |
== More examples of Quick Sort in practice == |
||
Line 61: | Line 39: | ||
:Please don't. Applications sections generally turn into spam magnets - long lists of unhelpful trivia. [[User:MrOllie|MrOllie]] ([[User talk:MrOllie|talk]]) 23:41, 12 March 2023 (UTC) |
:Please don't. Applications sections generally turn into spam magnets - long lists of unhelpful trivia. [[User:MrOllie|MrOllie]] ([[User talk:MrOllie|talk]]) 23:41, 12 March 2023 (UTC) |
||
::Got you. [[User:Wpengda|Wpengda]] ([[User talk:Wpengda|talk]]) 02:09, 15 March 2023 (UTC) |
|||
== More recent research on Quick Sort == |
== More recent research on Quick Sort == |
||
Line 67: | Line 46: | ||
:Given the formulaic nature of these talk page sections, I assume that you folks are participating in some sort of class. Please direct your instructor to [[Wikipedia:Education program]] for best practices for this kind of activity. [[User:MrOllie|MrOllie]] ([[User talk:MrOllie|talk]]) 20:59, 14 March 2023 (UTC) |
:Given the formulaic nature of these talk page sections, I assume that you folks are participating in some sort of class. Please direct your instructor to [[Wikipedia:Education program]] for best practices for this kind of activity. [[User:MrOllie|MrOllie]] ([[User talk:MrOllie|talk]]) 20:59, 14 March 2023 (UTC) |
||
:The cited article '''does not provide any proof about the worst case complexity''' of the proposed algorithm. By looking at the algorithm it is hard to believe that the worst case is n lg n. The algorithm simply avoids taking the lowest or highest value as pivot. [[User:Gilles Falquet|Gilles Falquet]] ([[User talk:Gilles Falquet|talk]]) 23:38, 20 March 2023 (UTC) |
|||
::I agree, this is just a conference paper and covering it here is likely [[WP:UNDUE]]. I'll remove it. [[User:MrOllie|MrOllie]] ([[User talk:MrOllie|talk]]) 16:44, 23 March 2023 (UTC) |
|||
== Is there a mismatch between the animated demo and the pseudocode of Hoare's partition scheme? == |
|||
The animated demonstration of Quicksort using Hoare's partition scheme seems to have one element sorted to its correct position after each partition routine and then omit it in the following recursions. Yet the pseudocode below claims that after one partition the pivot is then included in the next recursive call, which means no element should be omitted. Also the content below the pseudocode writes <i>"In this scheme, the pivot's final location is not necessarily at the index that is returned, as the pivot and elements equal to the pivot can end up anywhere within the partition after a partition step, and may not be sorted until the base case of a partition with a single element is reached via recursion."</i> My question is that is there a mismatch between the code and the animated demonstration (i.e. the demo is another scheme of quicksort)? (There is also a great chance that I have overlooked some details and misunderstood the material.) [[User:Student118|Student118]] ([[User talk:Student118|talk]]) 06:27, 11 September 2023 (UTC) |
Latest revision as of 10:27, 8 October 2024
This is the talk page for discussing improvements to the Quicksort article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
Archives: 1, 2, 3Auto-archiving period: 4 months |
This level-5 vital article is rated B-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
|
| |||
This page has archives. Sections older than 120 days may be automatically archived by Lowercase sigmabot III when more than 5 sections are present. |
This article links to one or more target anchors that no longer exist.
Please help fix the broken anchors. You can remove this template after fixing the problems. | Reporting errors |
Blog interview
[edit]The new blog post that purported holds an interview with Tony Hoare isn't needed — most of the history contained in it has already been divulged by Hoare in other places. I'll try to find out where so we can get rid of the blog. QVVERTYVS (hm?)
Wrongly placed reference? & text attribution
[edit]1. Reference 16 (at time of writing) is about the Yaroslavskiy algorithm, but it’s placed in the section about the Lomuto implementation. Shouldn’t it be removed there and inserted elsewhere, maybe in the History section?
The reference text (for reference :) Wild, Sebastian (2012). "Java 7's Dual Pivot Quicksort". Technische Universität Kaiserslautern.
2. The algorithm given in the Algorithm section seems to be taken almost verbatim from Yaroslavskiy (Reference 10). Would it be good to attribute it to that paper?
The reference text again: Yaroslavskiy, Vladimir (2009). "Dual-Pivot Quicksort" (PDF). Archived from the original (PDF) on 2 October 2015.
— Preceding unsigned comment added by Geke (talk • contribs) 25 August 2020 (UTC)
More examples of Quick Sort in practice
[edit]I am thinking about adding the section on Quick Sort's uses in various fields. While the Quick Sort article provides a comprehensive explanation of the algorithm, it could benefit from more real-world examples of how Quick Sort is used in different domains. For instance, the article could discuss how Quick Sort is used in data processing, image processing , or network analysis, and how it compares to other sorting algorithms in these contexts. This could help readers gain a better understanding of the practical applications of Quick Sort and strengthen it and weaknesses in different settings. Wpengda (talk) 23:34, 12 March 2023 (UTC)
- Please don't. Applications sections generally turn into spam magnets - long lists of unhelpful trivia. MrOllie (talk) 23:41, 12 March 2023 (UTC)
- Got you. Wpengda (talk) 02:09, 15 March 2023 (UTC)
More recent research on Quick Sort
[edit]Hello, I am thinking about adding the section on Quick Sort's recent research. While the Quick Sort article gives people the view of the quick sort algorithm, we can update some new findings to it to make it stay up to the new research. For example, when changing the pick of pivots will improve the worst case of time complexity from O(N^2) to O(NlogN). MiaoQiQi (talk) 20:55, 14 March 2023 (UTC)
- Given the formulaic nature of these talk page sections, I assume that you folks are participating in some sort of class. Please direct your instructor to Wikipedia:Education program for best practices for this kind of activity. MrOllie (talk) 20:59, 14 March 2023 (UTC)
- The cited article does not provide any proof about the worst case complexity of the proposed algorithm. By looking at the algorithm it is hard to believe that the worst case is n lg n. The algorithm simply avoids taking the lowest or highest value as pivot. Gilles Falquet (talk) 23:38, 20 March 2023 (UTC)
- I agree, this is just a conference paper and covering it here is likely WP:UNDUE. I'll remove it. MrOllie (talk) 16:44, 23 March 2023 (UTC)
Is there a mismatch between the animated demo and the pseudocode of Hoare's partition scheme?
[edit]The animated demonstration of Quicksort using Hoare's partition scheme seems to have one element sorted to its correct position after each partition routine and then omit it in the following recursions. Yet the pseudocode below claims that after one partition the pivot is then included in the next recursive call, which means no element should be omitted. Also the content below the pseudocode writes "In this scheme, the pivot's final location is not necessarily at the index that is returned, as the pivot and elements equal to the pivot can end up anywhere within the partition after a partition step, and may not be sorted until the base case of a partition with a single element is reached via recursion." My question is that is there a mismatch between the code and the animated demonstration (i.e. the demo is another scheme of quicksort)? (There is also a great chance that I have overlooked some details and misunderstood the material.) Student118 (talk) 06:27, 11 September 2023 (UTC)
- B-Class level-5 vital articles
- Wikipedia level-5 vital articles in Mathematics
- B-Class vital articles in Mathematics
- B-Class Computing articles
- Top-importance Computing articles
- All Computing articles
- B-Class Computer science articles
- Top-importance Computer science articles
- WikiProject Computer science articles