File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 22Comb sort is a relatively simple sorting algorithm originally designed by Wlodzimierz Dobosiewicz in 1980.
33Later it was rediscovered by Stephen Lacey and Richard Box in 1991. Comb sort improves on bubble sort.
44
5- This is pure python implementation of counting sort algorithm
5+ This is pure python implementation of comb sort algorithm
66For doctests run following command:
77python -m doctest -v comb_sort.py
88or
@@ -31,15 +31,15 @@ def comb_sort(data):
3131 i = 0
3232
3333 while gap > 1 or swapped :
34- # Update the gap value for a next comb
34+ # Update the gap value for a next comb
3535 gap = int (float (gap ) / shrink_factor )
3636
3737 swapped = False
3838 i = 0
3939
4040 while gap + i < len (data ):
4141 if data [i ] > data [i + gap ]:
42- # Swap values
42+ # Swap values
4343 data [i ], data [i + gap ] = data [i + gap ], data [i ]
4444 swapped = True
4545 i += 1
You can’t perform that action at this time.
0 commit comments