Sorting Problem: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
| Line 3: | Line 3: | ||
'''Input:''' A sequence of $n$ numbers $<a_1,a_2,a_3 \cdots a_n>$ | '''Input:''' A sequence of $n$ numbers $<a_1,a_2,a_3 \cdots a_n>$ | ||
'''Output:''' A permutated reordering $<a_1^`, a_2^`,a_3^` \cdots a_n^`>$ so that $<a_1^` \geq a_2^` \geq a_3^` \cdots \geq a_n^`>$ or $<a_1^` \leq a_2^` \leq a_3^` \cdots \leq a_n^`>$ | '''Output:''' A permutated reordering $<a_1^`, a_2^`,a_3^` \cdots a_n^`>$ so that $<a_1^` \geq a_2^` \geq a_3^` \cdots \geq a_n^`>$ or $<a_1^` \leq a_2^` \leq a_3^` \cdots \leq a_n^`>$ <ref>Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (2009). Introduction to Algorithms (3rd ed.). Cambridge, MA: The MIT Press. ISBN 978-0-262-03384-8.</ref> | ||
== References == | |||
<references /> | |||
Latest revision as of 18:44, 3 August 2026
This article is a stub. It might be missing pseudocode, complexity analysis, or a correctness sketch. It might need some other information which is incomplete perhaps.
The sorting problem is aimed at taking a numerically unordered list of sequence, and reordering this sequence into an ascended or descended sequence of order.
Input: A sequence of $n$ numbers $<a_1,a_2,a_3 \cdots a_n>$
Output: A permutated reordering $<a_1^`, a_2^`,a_3^` \cdots a_n^`>$ so that $<a_1^` \geq a_2^` \geq a_3^` \cdots \geq a_n^`>$ or $<a_1^` \leq a_2^` \leq a_3^` \cdots \leq a_n^`>$ [1]
References
- ↑ Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (2009). Introduction to Algorithms (3rd ed.). Cambridge, MA: The MIT Press. ISBN 978-0-262-03384-8.