冒泡排序算法

        /// <summary>
        /// 冒泡排序算法
        /// </summary>
        public static void BubbleSort()
        {
            int[] array = new int[] { 10, 2, 5, 1, 8, 6, 9 };
            int t = 0;
            for (int i = 0; i < array.Length - 1; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    if (array[i] < array[j])//前一个和当前的比较
                    {
                        t = array[i];
                        array[i] = array[j];
                        array[j] = t;
                    }
                }
            }
        }
原文地址:https://www.cnblogs.com/wms01/p/6603275.html