Jump to content

Sorting algorithms/Gnome sort: Difference between revisions

m
added a ;Task (bold) section header, added whitespace before the TOC.
m (added a ;Task (bold) section header, added whitespace before the TOC.)
Line 2:
{{Sorting Algorithm}}
{{Wikipedia|Gnome sort}}
 
 
Gnome sort is a sorting algorithm which is similar to [[Insertion sort]], except that moving an element to its proper place is accomplished by a series of swaps, as in [[Bubble Sort]].
 
Line 23 ⟶ 25:
'''done'''
 
 
'''Task''': implement the Gnome sort in your language to sort an array (or list) of numbers.
;Task:
'''Task''': implementImplement the Gnome sort in your language to sort an array (or list) of numbers.
<br><br>
 
=={{header|ActionScript}}==
<lang ActionScript>function gnomeSort(array:Array)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.