File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2
2
Comb sort is a relatively simple sorting algorithm originally designed by Wlodzimierz Dobosiewicz in 1980.
3
3
Later it was rediscovered by Stephen Lacey and Richard Box in 1991. Comb sort improves on bubble sort.
4
4
5
- This is pure python implementation of counting sort algorithm
5
+ This is pure python implementation of comb sort algorithm
6
6
For doctests run following command:
7
7
python -m doctest -v comb_sort.py
8
8
or
@@ -31,15 +31,15 @@ def comb_sort(data):
31
31
i = 0
32
32
33
33
while gap > 1 or swapped :
34
- # Update the gap value for a next comb
34
+ # Update the gap value for a next comb
35
35
gap = int (float (gap ) / shrink_factor )
36
36
37
37
swapped = False
38
38
i = 0
39
39
40
40
while gap + i < len (data ):
41
41
if data [i ] > data [i + gap ]:
42
- # Swap values
42
+ # Swap values
43
43
data [i ], data [i + gap ] = data [i + gap ], data [i ]
44
44
swapped = True
45
45
i += 1
You can’t perform that action at this time.
0 commit comments