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