@@ -32,13 +32,14 @@ $ pip install py-algorithms
3232 - Max PQ
3333 - Suffix Array
3434
35- ^ Search
35+ ^ Search Algorithms
3636 - Binary Search
3737
38- ^ Sorting
38+ ^ Sort Algorithms
3939 - Shell Sort (Shell method)
4040 - Heap Sort (Fibonacci heap)
4141 - Merge Sort
42+ - Comb Sort
4243 - Bubble Sort
4344 - Selection Sort
4445
@@ -98,6 +99,29 @@ sorting_algorithm(xs)
9899# => [-1, 0, 4, 5, 6, 7, 8, 9, 12]
99100```
100101
102+ #### * Comb Sort (https://en.wikipedia.org/wiki/Comb_sort)
103+
104+ Comb sort is a relatively simple sorting algorithm originally designed by
105+ Włodzimierz Dobosiewicz in 1980. Later it was rediscovered by Stephen Lacey and Richard Box in 1991.
106+ Comb sort improves on bubble sort. The basic idea is to eliminate turtles,
107+ or small values near the end of the list, since in a bubble sort these slow the sorting down tremendously.
108+ Rabbits, large values around the beginning of the list, do not pose a problem in bubble sort.
109+
110+ Worst case: О(n^2)
111+ Best case: О(n log n)
112+ Average: О(n^2)
113+ Worst case space: O(1)
114+
115+ ``` python
116+ from py_algorithms.sort import new_comb_sort
117+
118+ xs = [0 , 6 , 7 , 8 , 9 , 4 , 5 , 12 , - 1 ]
119+ sorting_algorithm = new_comb_sort()
120+ sorting_algorithm(xs)
121+
122+ # => [-1, 0, 4, 5, 6, 7, 8, 9, 12]
123+ ```
124+
101125#### * Selection Sort (https://en.wikipedia.org/wiki/Selection_sort)
102126
103127In computer science, selection sort is a sorting algorithm,
0 commit comments