Jump to content

Sorting algorithms/Gnome sort: Difference between revisions

m
m (→‎{{header|Phix}}: added syntax colouring the hard way)
Line 562:
arr: new items
while [i < size arr][
if? (arr \ [i-1)] =< arr \ [i] [
i: j
j: j + 1
]
else [
tmp: arr \ [i]
set arr \[i get]: arr \[i-1]
set arr \[i-1]: tmp
 
i: i-1
if i=0 [
1,532

edits

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