Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Sorting algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Related algorithms == Related problems include [[K-sorted sequence#Algorithms|approximate sorting]] (sorting a sequence to within a certain [[rank correlation|amount]] of the correct order), [[partial sorting]] (sorting only the ''k'' smallest elements of a list, or finding the ''k'' smallest elements, but unordered) and [[selection algorithm|selection]] (computing the ''k''th smallest element). These can be solved inefficiently by a total sort, but more efficient algorithms exist, often derived by generalizing a sorting algorithm. The most notable example is [[quickselect]], which is related to [[quicksort]]. Conversely, some sorting algorithms can be derived by repeated application of a selection algorithm; quicksort and quickselect can be seen as the same pivoting move, differing only in whether one recurses on both sides (quicksort, [[divide-and-conquer algorithm|divide-and-conquer]]) or one side (quickselect, [[decrease-and-conquer]]). A kind of opposite of a sorting algorithm is a [[shuffling algorithm]]. These are fundamentally different because they require a source of random numbers. Shuffling can also be implemented by a sorting algorithm, namely by a random sort: assigning a random number to each element of the list and then sorting based on the random numbers. This is generally not done in practice, however, and there is a well-known simple and efficient algorithm for shuffling: the [[Fisher–Yates shuffle]]. Sorting algorithms are ineffective for finding an order in many situations. Usually, when elements have no reliable comparison function (crowdsourced preferences like [[voting systems]]), comparisons are very costly ([[group tournament ranking system|sports]]), or when it would be impossible to pairwise compare all elements for all criteria ([[ranking (information retrieval)|search engines]]). In these cases, the problem is usually referred to as ''ranking'' and the goal is to find the "best" result for some criteria according to probabilities inferred from comparisons or rankings. A common example is in chess, where players are ranked with the [[Elo rating system]], and rankings are determined by a [[:Category:Tournament systems|tournament system]] instead of a sorting algorithm.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)