精简算法:
/*static void Main(string[] args)
{
int[] a = {1,2,3,4,5,6,7,8,9,10};
Array.Sort(a);
for (int i = 0; i < b.Length; i++)
{
Console.Write(b[i].ToString() + " ");
}
Console.ReadLine();
}
*/
常规算法:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
int[] a = {1,2,3,4,5,6,7,8,9,10};
int[] b = BubbleSort(a);
for (int i = 0; i < b.Length; i++)
{
Console.WriteLine(b[i].ToString() + " ");
}
Console.ReadLine();
}