Sorting Problem: Difference between revisions
Appearance
Initial text on sorting problem. |
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^` \ | '''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^`>$ | ||
Revision as of 18:40, 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^`>$