@@ -0,0 +1,953 @@
+package sortingalgorithms;%0A%0A/**%0A *  An implementation of Comb sort. It uses the golden ratio as the shrink factor.%0A *%0A *  @author  Joel Abrahamsson%0A *  @version %25G%25%0A */%0Apublic class CombSort implements SortingAlgorithm%0A%7B%0A  private final double SHRINK_FACTOR = 1.247330950103979;%0A%0A  public static CombSort sorter = new CombSort();%0A%0A  protected CombSort()%0A  %7B%0A  %7D%0A%0A  /**%0A   *  Sorts the given array using Comb sort.%0A   *%0A   *  @param array array to be sorted%0A   */%0A  public void sort(int%5B%5D array)%0A  %7B%0A    int length = array.length,%0A        gap    = length;%0A%0A    boolean swapped = false;%0A%0A    while (gap %3E 1 %7C%7C swapped)%0A    %7B%0A      gap = (int)((double)gap / SHRINK_FACTOR);%0A      %0A      if (gap %3C 0)%0A        gap = 1;%0A%0A      swapped = false;%0A      for (int i = 0; (gap + i) %3C length; i++)%0A      %7B%0A        if ((array%5Bi%5D - array%5Bi + gap%5D) %3E 0)%0A        %7B%0A          CommonMethods.swap(array, i, i + gap);%0A          swapped = true;%0A        %7D%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A

Implement Comb sort