public void sort(int[] array)
  {
    int length = array.length,
        gap    = length;

    boolean swapped = false;

    while (gap > 1 || swapped)
    {
      gap = (int)((double)gap / SHRINK_FACTOR);
      
      if (gap < 0)
        gap = 1;

      swapped = false;
      for (int i = 0; (gap + i) < length; i++)
      {
        if ((array[i] - array[i + gap]) > 0)
        {
          CommonMethods.swap(array, i, i + gap);
          swapped = true;
        }
      }
    }
  }