冒泡排序

for (int i = 0; i < array.Length; i++)
            {
                for (int j = i; j < array.Length; j++)
                {
                    if (Convert.ToInt32(array[i]) > Convert.ToInt32(array[j]))
                    {
                        var temp = array[i];
                        array[i] = array[j];
                        array[j] = temp;
                      
                    }
                }
            }

 

posted @ 2015-03-23 17:35  逍遥帝君  阅读(140)  评论(0编辑  收藏  举报