Sorting algorithms/Pancake sort: Difference between revisions

m
added a ;Related tasks: and a ;See also:, used a over/under for the example; moved the mention of two Rosetta Code tasks from the :Also see: to the Related tasks section.
(add task to aarch64 assembly raspberry pi)
m (added a ;Related tasks: and a ;See also:, used a over/under for the example; moved the mention of two Rosetta Code tasks from the :Also see: to the Related tasks section.)
Line 7:
 
In short, instead of individual elements being sorted, the only operation allowed is to "flip" one end of the list, like so:
Before: '''9 86 7 68 9''' 2 5 3 4 1
Before:
After: '''6 79 8 97 6''' 2 5 3 4 1
After:
'''9 8 7 6''' 2 5 3 4 1
 
Only one end of the list can be flipped; this should be the low end, but the high end is okay if it's easier to code or works better, but it '''must''' be the same end for the entire solution. (The end flipped can't be arbitrarily changed.)
Line 16 ⟶ 14:
Show both the initial, unsorted list and the final sorted list. (Intermediate steps during sorting are optional.) Optimizations are optional (but recommended).
 
For more information on pancake sorting, see [[wp:Pancake sorting|the Wikipedia entry]].
 
;Related tasks:
See also:
*   [[Number reversal game]]
*   [[Topswops]]
 
 
;Also see:
*   Wikipedia article:   [[wp:Pancake sorting|pancake sorting]].
<br><br>
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}