131
правка
Изменения
→Модификации
swapped = true;
'''function''' shakerSort: begin = -1 end = n - 2 '''while''' swapped swapped = ''false'' begin++ '''for''' i= begin to end '''if''' A[i] > A[i+1] swap(A[i],A[i+1]) swapped = ''true'' '''if''' swapped = false '''break''' swapped = ''false'' end = end - 1 '''for''' i = end '''downto''' begin '''if''' A[i]>A[i+1] swap(A[i],A[i+1]) swapped = ''true''