Sort the letters of string in alphabetical order: Difference between revisions
Sort the letters of string in alphabetical order (view source)
Revision as of 20:32, 11 June 2023
, 11 months agoadd RPL
(K) |
(add RPL) |
||
Line 1,367:
Output: aaaeeefgggggiilmmnnnooprrrrruv
done...
</pre>
=={{header|RPL}}==
{{works with|HP|48G}}
≪ { }
1 3 PICK SIZE '''FOR''' j
OVER j DUP SUB + '''NEXT'''
SWAP DROP
SORT ∑LIST
≫ '<span style="color:blue">STRORT</span>' STO
"The quick brown fox jumps over the lazy dog, apparently" <span style="color:blue">STRORT</span>
{{out}}
<pre>
1: " ,Taaabcdeeeefghhijkllmnnoooopppqrrrsttuuvwxyyz"
</pre>
Line 1,400 ⟶ 1,415:
,Taaabcdeeeefghhijkllmnnoooopppqrrrsttuuvwxyyz
</pre>
=={{header|Wren}}==
Well, we'll write a function for a bubble sort which we don't have in Wren-sort because it's normally much slower than the other methods. However, it's fast enough here.
|