Jump to content

Sorting algorithms/Gnome sort: Difference between revisions

m
→‎{{header|RPL}}: improved code
(added RPL)
m (→‎{{header|RPL}}: improved code)
 
Line 4,095:
« 2
'''WHILE''' h s < '''REPEAT'''
'''IF''' OVER h GETIDUP UNROT1 GET+ SUB EVAL ≤ '''THEN'''
'h' ▶ 1 +
'''ELSE'''
Line 4,109:
1: { 0 1 2 3 4 5 6 7 8 9 }
</pre>
This implementation of gnome sort is 3330 times slower than the <code>SORT</code> built-in function on a HP-50g.
 
=={{header|Ruby}}==
1,151

edits

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