Jump to content

Sorting algorithms/Comb sort: Difference between revisions

minimum gap is 1
(→‎{{header|Ruby}}: ++ sather)
(minimum gap is 1)
Line 7:
'''function''' combsort('''array''' input)
gap := input'''.size''' ''//initialize gap size''
'''loop until''' gap <= 1 '''and''' swaps = 0
''//update the gap value for a next comb. Below is an example''
'''if'''gap := int(gap >/ 1.25)
'''if''' gap := int(gap /< 1.25)
''//minimum gap is 1''
gap := 1
'''end if'''
i := 0
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.