Insertion sort: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m Bot: Correzione di uno o più errori comuni |
|||
Riga 27:
'''function''' insertionSortIterativo(array A)
'''for''' i ← 1 '''to''' length[A]
'''do''' value ← A[i]
j ← i-1
'''while''' j >= 0 '''and''' A[j] > value
j ← j-1
A[j+1] ← value;
Riga 44:
value ← A[n-1]
j ← n-2
'''while''' j >= 0 '''and''' A[j] > value
j ← j-1
A[j+1] ← value
|