C# Implementation

suggest change
public static class ShellSort
{
    public static void Sort(int[] values)
    {
        for (int gap = values.Length / 2; gap > 0; gap /= 2)
        {
            for (int index = gap; index < values.Length; index++)
            {
                int item = values[index];
                int destination = index;
                while (destination >= gap && values[destination - gap] > item)
                {
                    values[destination] = values[destination - gap];
                    destination -= gap;
                }
                values[destination] = item;
            }
        }
    }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents