class Program
{static void Main(string[] args)
{
Custom<string> custom = new Custom<string>();
custom.Add("456");
custom.Add("123");
custom.Add("789");
custom.SystemSort();
custom.QuickSort(0, 2);
custom.InsertSort();
custom.ChooseSort();
custom.BubbleSort();
foreach (string str in custom)
{
Console.WriteLine(str);
}
for (int i = 0; i < custom.Capacity; i++)
{
Console.WriteLine(custom[i]);
}
}
}
{
List<T> list;
public Custom()//初始化集合
{
list = new List<T>();
}
public int Capacity//封装属性
{
get { return list.Count; }
}
public void Add(T value)//添加元