Sorting algorithms/Gnome sort: Difference between revisions

Content added Content deleted
m (→‎Icon and Unicon: header simplification)
Line 552: Line 552:
lst gnomeSortInPlace println # ==> list(-4, -1, 2, 5, 9)</lang>
lst gnomeSortInPlace println # ==> list(-4, -1, 2, 5, 9)</lang>


== Icon and Unicon ==
=={{header|Icon}} and {{header|Unicon}}==
==={{header|Icon}}===
<lang Icon>procedure main() #: demonstrate various ways to sort a list and string
<lang Icon>procedure main() #: demonstrate various ways to sort a list and string
demosort(gnomesort,[3, 14, 1, 5, 9, 2, 6, 3],"qwerty")
demosort(gnomesort,[3, 14, 1, 5, 9, 2, 6, 3],"qwerty")
Line 582: Line 581:
on string : "qwerty"
on string : "qwerty"
with op = &null: "eqrtwy" (0 ms)</pre>
with op = &null: "eqrtwy" (0 ms)</pre>

==={{header|Unicon}}===
The Icon solution works in Unicon.


=={{header|J}}==
=={{header|J}}==