选择排序_排序算法_算法

选择排序:

  public static void Sort(int []array)
        {
            int temp = 0;
            int t = 0;
            for(int i=0;i<array.Length-1;i++)
            {
                temp = array[i];
                t = i;
                for (int j = i; j < array.Length;j++ )
                {
                    if (temp > array[j])
                    {
                        temp = array[j];
                        t = j;
                    }
                }
                if (t != i)
                {
                    array[t] = array[i];
                    array[i] = temp;
                }
            }
        }
原文地址:https://www.cnblogs.com/steben/p/3133387.html