Sorting algorithms/Comb sort: Difference between revisions
Content added Content deleted
m (format the pseudocode) |
m (missed a spot) |
||
Line 13: | Line 13: | ||
swaps := 0 ''//see [[Bubble Sort]] for an explanation'' |
swaps := 0 ''//see [[Bubble Sort]] for an explanation'' |
||
''//a single "comb" over the input list'' |
''//a single "comb" over the input list'' |
||
'''loop until''' i + gap >= input.size ''//see [[Shell sort]] for similar idea'' |
'''loop until''' i + gap >= input'''.size''' ''//see [[Shell sort]] for similar idea'' |
||
'''if''' input[i] > input[i+gap] |
'''if''' input[i] > input[i+gap] |
||
'''swap'''(input[i], input[i+gap]) |
'''swap'''(input[i], input[i+gap]) |