Commit Graph

6 Commits

Author SHA1 Message Date
valery noname
a6ae951580 fix: removed warning for Sorts 'C-style array declaration of parameter 'array'' 2019-12-30 13:03:14 +07:00
yanglbme
29948363da docs: update the whole repository
* fix some bugs
* delete duplicate files
* format code
2019-05-09 19:32:54 +08:00
varunu28
819b7fd3da Restructured the repo 2018-11-13 09:15:47 -08:00
nik
cf778675df Comb sort was implemented 2018-04-12 10:14:22 +03:00
Sandeep Roy
f8542e4db7
Updated CombSort.java
As requested done the changes.
2018-04-05 14:31:51 +05:30
sandeeproy99
07015c1e64
CombSort.java
Comb Sort is mainly an improvement over Bubble Sort. Bubble sort always compares adjacent values. So all inversions are removed one by one. Comb Sort improves on Bubble Sort by using gap of size more than 1. The gap starts with a large value and shrinks by a factor of 1.3 in every iteration until it reaches the value 1. Thus Comb Sort removes more than one inversion counts with one swap and performs better than Bubble Sort.

The shrink factor has been empirically found to be 1.3 (by testing CombSort on over 200,000 random lists) [Source: Wiki]

Although, it works better than Bubble Sort on average, worst case remains O(n2).
2017-10-28 16:03:26 +05:30