摘要: 1.插入排序 算法思想: 插入算法使用两层嵌套循环,逐个处理待插入的记录。每个记录与前面排好的记录序列进行比较,并将该记录插入合适的位置。 代码: internal class SortAlgorithm { public static void InsertSort<T,C>(T[] array, C comparer) where C:IComparer<T> { for (int i = 1; i < array.Length; i++) { int j = i; while (j>=1&& comparer.Compare(array 阅读全文
posted @ 2011-08-08 17:36 Len King 阅读(132) 评论(0) 推荐(0) 编辑