#冒泡排序方法拓展
利用委托来拓展通用的冒泡排序方法
前言
利用委托来扩展冒泡排序,除了int类型外还可以用到任意所需要排序
二、使用步骤
1.引入库
代码如下(示例):
class Employee{
public string Name{
get;private set;}
public int Salary{
get;private set;}
public Employee(string name,int salary)
{
this.Name = name;
this.Salary = salary;
}
//如果e1大于e2的话,就返回true,否则返回false
public static bool Compare(Emploee e1,Emploee e2)