Jump to content

Sorting algorithms/Gnome sort: Difference between revisions

m
→‎{{header|R}}: Syntax highlighting.
(→‎{{header|Swift}}: Added a SNOBOL4 implementation.)
m (→‎{{header|R}}: Syntax highlighting.)
Line 2,881:
=={{header|R}}==
===Starting from 1===
<lang rrsplus>gnomesort <- function(x)
{
i <- 1
Line 2,912:
 
As R is 1-indexed, we need to make some minor adjustments to the given pseudo-code. To give some variety and to remove the previous solution's potentially redundant first run, we have chosen a different adjustment to the previous solution's. We have otherwise aimed to be faithful to the pseudo-code.
<lang rrsplus>gnomeSort<-function(a)
{
i<-2
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.