1、选择排序
2、冒泡排序
static void Main(string[] args)
{
int[] array = new int[] { 1, 5, 3, 6, 10, 55, 9, 2, 87, 12, 34, 75, 33, 47 };
EbullitionSorter e = new EbullitionSorter ();
e.Sort(array);
foreach (int m in array)
Console.WriteLine("{0}", m);
}
}
3、快速排序
static void Main(string[] args)
{
int[] iArrary = new int[] { 1, 5, 3, 6, 10, 55, 9, 2, 87, 12, 34, 75, 33, 47 };
QuickSorter q = new QuickSorter();
q.Sort(iArrary, 0, 13);
for (int m = 0; m <= 13; m++)
Console.WriteLine("{0}", iArrary[m]);
}
}
4、插入排序
5、希尔排序
static void Main(string[] args)
{
int[] array = new int[] { 1, 5, 3, 6, 10, 55, 9, 2, 87, 12, 34, 75, 33, 47 };
ShellSorter s = new ShellSorter();
s.Sort(array);
foreach (int m in array)
Console.WriteLine("{0}", m);
}
}
转载:http://blog.csdn.net/gisfarmer/archive/2009/05/05/4152345.aspx